From c309174fdbb6b082113ac320294066c37922f2ce Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 19 Feb 2024 21:23:35 -0500 Subject: [PATCH] only: part one of configurable test VBatt --- .github/workflows/hardware-ci.yaml | 5 +++++ .../src/main/java/com/rusefi/proteus/ProteusAnalogTest.java | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hardware-ci.yaml b/.github/workflows/hardware-ci.yaml index 24d30948bf..441099db8d 100644 --- a/.github/workflows/hardware-ci.yaml +++ b/.github/workflows/hardware-ci.yaml @@ -21,6 +21,7 @@ jobs: folder: config/boards/f407-discovery openocd-script: ../.github/workflows/openocd_ci_f4_discovery.cfg serial-device: /dev/serial/by-id/usb-rusEFI_LLC_rusEFI_Engine_Management_ECU_2B003B000A51343033393930-if01 + vbatt_supply: 12 - build-target: proteus_f4 runs-on: hw-ci-proteus @@ -28,6 +29,7 @@ jobs: folder: config/boards/proteus openocd-script: ../.github/workflows/openocd_ci_proteus_f4.cfg serial-device: /dev/serial/by-id/usb-rusEFI_LLC_rusEFI_Engine_Management_ECU_41003D000451383037343335-if01 + vbatt_supply: 12 - build-target: proteus_f7 runs-on: hw-ci-proteus-f7 @@ -35,6 +37,8 @@ jobs: folder: config/boards/proteus openocd-script: ../.github/workflows/openocd_ci_proteus_f7.cfg serial-device: /dev/serial/by-id/usb-rusEFI_LLC_rusEFI_Engine_Management_ECU_38002D0005504B4634303120-if01 + # let's power Proteus from same DC adapter as Nuc PC + vbatt_supply: 12 runs-on: ${{matrix.runs-on}} @@ -92,6 +96,7 @@ jobs: # ls -l /dev/serial/by-id/ - name: Set EXTRA env run: | + echo "HARDWARE_CI_VBATT=${{matrix.vbatt_supply}}" >> $GITHUB_ENV echo "HARDWARE_CI_SERIAL_DEVICE=${{matrix.serial-device}}" >> $GITHUB_ENV # This both compiles and runs HW CI tests diff --git a/java_console/autotest/src/main/java/com/rusefi/proteus/ProteusAnalogTest.java b/java_console/autotest/src/main/java/com/rusefi/proteus/ProteusAnalogTest.java index f587154f47..84f5dece14 100644 --- a/java_console/autotest/src/main/java/com/rusefi/proteus/ProteusAnalogTest.java +++ b/java_console/autotest/src/main/java/com/rusefi/proteus/ProteusAnalogTest.java @@ -25,9 +25,11 @@ public class ProteusAnalogTest extends RusefiTestBase { @Test public void testVbatt() { double vbatt = SensorCentral.getInstance().getValue(Sensor.VBATT); + String expectedVbattString = System.getenv("HARDWARE_CI_VBATT"); + double expectedVbatt = expectedVbattString == null ? 12 : Double.parseDouble(expectedVbattString); // allow some tolerance for the supply voltage... - assertTrue("VBatt " + vbatt + " out of range", vbatt > 11 && vbatt < 13); + assertTrue("VBatt " + vbatt + " out of range", vbatt > 0.9 * expectedVbatt && vbatt < 1.1 * expectedVbatt); } // not really 'analog' test. Not the best placement since we are unable to rebuild discovery HW CI :(