Skip to content

fix(tests): security/test_redis_network_isolation.py needs REDIS_BACKEND_PASSWORD env var or a skip-when-unset guard #764

Closed

Description

@AndriiPasternak31

Summary

3 tests in tests/security/test_redis_network_isolation.py fail with KeyError: 'REDIS_BACKEND_PASSWORD':

  • test_platform_container_can_authenticate
  • test_backend_acl_blocks_flushall
  • test_backend_acl_blocks_config_get

The variable is set in production .env but is NOT exported by tests/run-full.sh or required by tests/requirements-test.txt's implicit env contract. The fixture reads it directly via os.environ["REDIS_BACKEND_PASSWORD"], so any contributor who hasn't pre-exported the variable hits a hard KeyError.

Context

Discovered via full test suite run on 2026-05-09. Per architecture.md "Network Topology (Issue #589)", the variable is the password for the Redis ACL backend user — required only if you want these tests to actually exercise the platform-network ACL.

Acceptance Criteria

Pick one option:

Option 1 (recommended): skip-when-unset

  • Wrap the affected fixtures in:
    if "REDIS_BACKEND_PASSWORD" not in os.environ:
        pytest.skip("REDIS_BACKEND_PASSWORD not set; skipping platform-network ACL test")
  • All 3 tests skip cleanly when the var is unset, run normally when it's set.
  • Document the env requirement in tests/security/README.md (if absent, add a one-line note).

Option 2: source .env in run scripts

  • tests/run-full.sh and tests/run-core.sh source ../.env before running pytest.
  • Risk: leaks other production secrets into CI test logs unless gated by a --security flag.

Option 1 is non-invasive and follows the pattern other live-backend tests already use (e.g. WhatsApp integration tests skip without Twilio binding). Option 2 risks broader secret exposure.

Related

Activity

  1. added
    status-in-progress
    on May 11, 2026
  2. self-assigned this
    on May 11, 2026
  3. added
    status-in-dev
    and removed
    status-in-progress
    on May 28, 2026
  4. vybe commented on Jun 1, 2026

    @vybe
    Contributor

    Shipped in v0.6.0 (released via #998).

  5. added
    theme-devex
    and removed
    status-in-dev
    on Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority-p3theme-devextype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions