diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a9bb3c897..7a02df9e0 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -216,6 +216,12 @@ jobs: - name: Run push-time tests run: make test env: + RUNTIME_CACHE_MODE: local + RUNTIME_CACHE_URL: redis://127.0.0.1:6379/0 + RUNTIME_CACHE_URL_SECRET_RESOURCE: "" + RUNTIME_CACHE_CA_CERT_SECRET_RESOURCE: "" + RUNTIME_CACHE_ENVIRONMENT: test + RUNTIME_CACHE_SERVICE: api POLICYENGINE_DB_PASSWORD: ${{ secrets.POLICYENGINE_DB_PASSWORD }} POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN: ${{ secrets.POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} diff --git a/changelog.d/staging-cache-test-environment.fixed.md b/changelog.d/staging-cache-test-environment.fixed.md new file mode 100644 index 000000000..ed7c87204 --- /dev/null +++ b/changelog.d/staging-cache-test-environment.fixed.md @@ -0,0 +1 @@ +Fix the post-merge staging workflow so its predeployment test suite uses the local Redis service instead of inheriting managed-cache secret references. diff --git a/tests/unit/test_cloud_run_deploy_scripts.py b/tests/unit/test_cloud_run_deploy_scripts.py index 1216e4914..7e4a90d78 100644 --- a/tests/unit/test_cloud_run_deploy_scripts.py +++ b/tests/unit/test_cloud_run_deploy_scripts.py @@ -1727,6 +1727,23 @@ def test_push_workflow_tests_app_engine_and_cloud_run_staging_tracks(): ) +def test_push_workflow_uses_local_redis_for_predeployment_test_suite(): + staging = _workflow_job_block(_push_workflow(), "deploy-staging") + test_step_start = staging.index("- name: Run push-time tests") + test_step_end = staging.index( + "- name: Validate App Engine deployment configuration", + test_step_start, + ) + test_step = staging[test_step_start:test_step_end] + + assert "RUNTIME_CACHE_MODE: local" in test_step + assert "RUNTIME_CACHE_URL: redis://127.0.0.1:6379/0" in test_step + assert 'RUNTIME_CACHE_URL_SECRET_RESOURCE: ""' in test_step + assert 'RUNTIME_CACHE_CA_CERT_SECRET_RESOURCE: ""' in test_step + assert "RUNTIME_CACHE_ENVIRONMENT: test" in test_step + assert "RUNTIME_CACHE_SERVICE: api" in test_step + + def test_push_workflow_staging_fully_gates_all_production_deployments(): workflow = _push_workflow() app_engine_candidate = _workflow_job_block(workflow, "deploy-production-candidate")