Skip to content

test: Mock Testing 'Security - Credential Protection' test returns None (causes Mock Testing CI red) #21850

Description

@drussell23

Symptom

The Mock Testing (Safe) workflow runs the inline-defined Python test script screen_lock_e2e_test.py (created at runtime in screen-lock-e2e-test.yml via heredoc). After the setuptools fix landed in PR #21835 (closes #21796), the script now boots successfully and runs all 6 mock tests. 5 pass; 1 fails:

✅ Lock Screen (50.22ms)
✅ Unlock Screen (50.21ms)
✅ Voice Command Lock (150.57ms)
✅ Voice Command Unlock (150.52ms)
❌ Security - Credential Protection - None

The Security - Credential Protection test returns None (which falsy-checks as failure in the test runner). 5 passes + 1 failure → report.tests_failed > 0sys.exit(1) → workflow red.

Failing check

Root cause hypothesis

The mock test method for Security - Credential Protection likely doesn't return TestResult(...) like its siblings — it just returns implicitly (None). The test runner correctly classifies None as a failure.

Look at the inline-heredoc'd script at .github/workflows/screen-lock-e2e-test.yml (the section starting around line 188 with cat > .github/workflows/scripts/screen_lock_e2e_test.py << 'EOFTEST'). Search for the credential-protection test method and ensure it returns a proper TestResult(passed=True/False, …).

Discovery context

Before PR #21835, this test never ran because the script crashed at boot with ModuleNotFoundError: No module named 'pkg_resources'. The setuptools fix in #21835 unblocked execution and exposed this latent bug. The credential-protection test has been broken since the workflow was authored; the boot crash was masking it.

Scope

Small fix — likely a 1–3 line change to the inline test script in screen-lock-e2e-test.yml to return a proper TestResult. Not blocking PR #21835 from merging since:

  1. The fix in chore(ci): Fix CI infra failures (orphan submodule, setuptools, diagram-output) #21835 (setuptools) is correct and demonstrably works (script now runs)
  2. This is a separate pre-existing test bug that the fix exposed
  3. Same hygiene pattern as ci/docs: document GOOGLE_APPLICATION_CREDENTIALS and JARVIS_DB_* in .env.example / ENV_VARS.md #21847 (.env.example gap)

Suggested labels

ci/cd, ci-failure, bug (the test code returns None instead of a TestResult)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingci-failureCI/CD workflow failureci/cd

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions