[#2796] Covered 'ENVIRONMENT_TYPE' in test isolation and container runtime. - #2803
Conversation
WalkthroughThe compose setup now supports explicit ChangesCompose environment propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/phpunit/Drupal/SettingsTestCase.php`:
- Around line 76-78: Update getRealEnvVarsFilteredNoValues() so ENVIRONMENT_TYPE
is matched only as an exact environment-variable name, while the other allowlist
entries retain their existing prefix matching behavior. Keep the test’s intent
and comment aligned with this separate exact-name handling, preventing matches
such as ENVIRONMENT_TYPE_FOO.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 790d5d18-2615-41b9-8aad-df8c114a9d11
⛔ Files ignored due to path filters (31)
.vortex/installer/tests/Fixtures/handler_process/_baseline/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/SettingsTestCase.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_search_without_solr/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/SettingsTestCase.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/SettingsTestCase.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_enabled/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_acquia/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_container_registry/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_ftp/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_lagoon/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_s3/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_url/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_none/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_string/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/services_no_clamav/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/services_no_redis/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/services_no_solr/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/services_none/docker-compose.ymlis excluded by!.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (8)
.ahoy.yml.vortex/tests/phpunit/Fixtures/docker-compose.env.json.vortex/tests/phpunit/Fixtures/docker-compose.env_local.json.vortex/tests/phpunit/Fixtures/docker-compose.env_mod.json.vortex/tests/phpunit/Fixtures/docker-compose.noenv.jsondocker-compose.ymltests/phpunit/Drupal/EnvironmentSettingsTest.phptests/phpunit/Drupal/SettingsTestCase.php
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
|
📖 Documentation preview for this pull request has been deployed to Netlify: https://6a5886c17526f8d8a6e80c18--vortex-docs.netlify.app This preview is rebuilt on every commit and is not the production documentation site. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2803 +/- ##
==========================================
- Coverage 86.71% 86.27% -0.44%
==========================================
Files 97 90 -7
Lines 4757 4598 -159
Branches 47 3 -44
==========================================
- Hits 4125 3967 -158
+ Misses 632 631 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
Closes #2796
Summary
The
DRUPAL_ENVIRONMENTtoENVIRONMENT_TYPErename in 1.40 leftENVIRONMENT_TYPEoutside two prefix-based allowlists that previously caught it via theDRUPAL_prefix. A host- or CI-setENVIRONMENT_TYPEleaked into PHPUnit settings tests that do not set it explicitly, making environment assertions host-dependent, andENVIRONMENT_TYPEoverrides were no longer forwarded into thecli/php/nginxcontainers at runtime. This PR closes both gaps.Changes
Test isolation
ENVIRONMENT_TYPEtoSettingsTestCase::ALLOWED_ENV_VARS(tests/phpunit/Drupal/SettingsTestCase.php), so a host-set value is cleared between settings test cases.Runtime passthrough
.ahoy.yml: added theENVIRONMENT_prefix to theahoy cli/ahoy shellenvironment-forwardinggreppattern (alongsideDRUPAL_,VORTEX_, etc.), so anENVIRONMENT_TYPEoverride set on the host reaches theclicontainer.docker-compose.yml: addedENVIRONMENT_TYPE: ${ENVIRONMENT_TYPE:-}to the shared&default-environmentanchor, so every service built on it also receives the override.Tests
.vortex/tests/phpunit/Traits/Subtests/SubtestAhoyTrait::subtestAhoyCli()to assert thatahoy cliforwards a hostENVIRONMENT_TYPEinto the container. This lives in the template's own test suite (.vortex/tests/), which is not shipped to consumer projects. Thedocker-compose.ymlpassthrough is covered byDockerComposeTestand its regenerated fixtures.Regenerated fixtures
handler_processfixtures under.vortex/installer/tests/Fixtures/handler_process/**(docker-compose.yml,.ahoy.yml,SettingsTestCase.php) regenerated viaahoy update-snapshotsto match the source changes above..vortex/tests/phpunit/Fixtures/docker-compose.env*.jsonfixtures regenerated to include the newENVIRONMENT_TYPEkey in the expected container environment output.Screenshots
N/A - this change is non-visual (test infrastructure and environment variable passthrough only).
Before / After