[#2261] Fixed Acquia settings to allow DRUPAL_CONFIG_PATH override independently of config_vcs_directory.#2263
Conversation
WalkthroughAdds a unit test for DRUPAL_CONFIG_PATH overriding and reorders/centralizes DRUPAL_CONFIG_PATH handling and htaccess creation in Acquia-specific settings to apply the environment variable regardless of config_vcs_directory presence. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@tests/phpunit/Drupal/EnvironmentSettingsTest.php`:
- Around line 781-785: Add a new unit test (or extend
testEnvironmentAcquiaConfigPathOverride) to verify the fallback to
config_vcs_directory when DRUPAL_CONFIG_PATH is not set: clear/unset
DRUPAL_CONFIG_PATH in the environment, pre-populate/mock the settings array key
$settings['config_vcs_directory'] to a test path before including/loading the
Acquia settings logic, then assert that the resulting config path resolution
uses that $settings['config_vcs_directory'] value; reference the existing
testEnvironmentAcquiaConfigPathOverride behavior and the
$settings['config_vcs_directory'] symbol when implementing the mock and
assertions.
| public function testEnvironmentAcquiaConfigPathOverride(): void { | ||
| $this->setEnvVars([ | ||
| 'AH_SITE_ENVIRONMENT' => 1, | ||
| 'DRUPAL_CONFIG_PATH' => 'custom_acquia_config', | ||
| ]); |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider adding a test for the config_vcs_directory fallback path.
The test covers the DRUPAL_CONFIG_PATH override scenario but doesn't verify the fallback to config_vcs_directory when DRUPAL_CONFIG_PATH is absent. While the Acquia settings file that sets config_vcs_directory is excluded from coverage (due to file system dependencies), you could potentially mock this by pre-setting $settings['config_vcs_directory'] before including the settings file, if the test harness supports it.
🤖 Prompt for AI Agents
In `@tests/phpunit/Drupal/EnvironmentSettingsTest.php` around lines 781 - 785, Add
a new unit test (or extend testEnvironmentAcquiaConfigPathOverride) to verify
the fallback to config_vcs_directory when DRUPAL_CONFIG_PATH is not set:
clear/unset DRUPAL_CONFIG_PATH in the environment, pre-populate/mock the
settings array key $settings['config_vcs_directory'] to a test path before
including/loading the Acquia settings logic, then assert that the resulting
config path resolution uses that $settings['config_vcs_directory'] value;
reference the existing testEnvironmentAcquiaConfigPathOverride behavior and the
$settings['config_vcs_directory'] symbol when implementing the mock and
assertions.
…independently of `config_vcs_directory`.
6b526b5 to
2eec47f
Compare
|
|
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2263 +/- ##
==========================================
- Coverage 77.05% 76.44% -0.61%
==========================================
Files 114 107 -7
Lines 5988 5829 -159
Branches 44 0 -44
==========================================
- Hits 4614 4456 -158
+ Misses 1374 1373 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Closes #2261
Summary by CodeRabbit
Tests
Refactor