diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 24b6ae8332..8cf8fd0b2b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -186,6 +186,11 @@ jobs: - name: Build openpilot id: build run: scons + - name: Provide H.264 encoder for Android Auto integration tests + if: ${{ !cancelled() && steps.build.outcome == 'success' }} + run: | + uv pip install --python .venv/bin/python --only-binary av av==19.0.1 + .venv/bin/python -c "import av; assert 'libx264' in av.codecs_available" - name: Run unit tests if: ${{ !cancelled() && steps.build.outcome == 'success' }} timeout-minutes: ${{ contains(runner.name, 'nsc') && 2 || 20 }} diff --git a/openpilot/starpilot/galaxy/tests/test_android_auto.mjs b/openpilot/starpilot/galaxy/tests/test_android_auto.mjs index 84188a5109..a1af03b43c 100644 --- a/openpilot/starpilot/galaxy/tests/test_android_auto.mjs +++ b/openpilot/starpilot/galaxy/tests/test_android_auto.mjs @@ -18,7 +18,8 @@ assert.equal(validPromptInput({ kind: "passkey" }, "1234567"), false) assert.equal(validPromptInput(prompt, ""), true) assert.match(AndroidAutoPage.template, /Check that this code matches your car/) assert.match(AndroidAutoPage.template, /Cancel Search \/ Pairing/) -assert.match(AndroidAutoPage.template, /Wired USB setup is unavailable/) +assert.match(AndroidAutoPage.template, /:row="wiredRow"[^>]*:disabled="wiredDisabled"/) +assert.match(AndroidAutoPage.template, /A direct USB cable from the comma to the car is supported as Wired USB Connection/) assert.doesNotMatch(AndroidAutoPage.template, /v-html|autoaccept/i) const app = readFileSync(new URL("../web/js/app.js", import.meta.url), "utf8") assert.match(app, /AndroidAutoPage v-else-if="route\.path === '\/android-auto'"/) @@ -159,6 +160,24 @@ function page(selectedSetup = setup) { for (const [key, method] of Object.entries(AndroidAutoPage.methods)) vm[key] = method.bind(vm) return vm } +// Wired setup is available, while the existing parked/session/ownership gates remain enforced. +const wiredSetup = page() +wiredSetup.runtime = { connection: "wireless", running: false } +assert.equal(wiredSetup.wiredDisabled, false) +for (const field of ["enabled", "parked"]) { + const blocked = page({ ...setup, [field]: false }) + assert.equal(blocked.wiredDisabled, true, field) +} +wiredSetup.pairing = { active: true } +assert.equal(wiredSetup.wiredDisabled, true, "pairing owns the connection") +wiredSetup.pairing = null +wiredSetup.runtime.running = true +assert.equal(wiredSetup.wiredDisabled, true, "a running session cannot change connection") +wiredSetup.runtime = { connection: "wireless", running: false, wired_blocked: "USB is busy" } +assert.equal(wiredSetup.wiredDisabled, true, "another USB owner blocks enabling wired mode") +wiredSetup.runtime.connection = "wired" +assert.equal(wiredSetup.wiredDisabled, false, "the existing wired connection can still be disabled") + const uploadPage = page({ ...setup, enabled: false }) const uploadCalls = [] uploadPage.feed = { diff --git a/prebuilt.json b/prebuilt.json index ccc011bc2e..3a98fa1f39 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "6898cb0e30c38f6155bc57606d14421592f78684e956514af89a271c302f4a0d", "schema_version": 1} +{"protected_inventory_sha256": "761e6890c245123ed631eac27a1f0562d201ea7145bb5318418bf55b0b976143", "schema_version": 1}