Skip to content

fix: StubGeocoderTest fails on every forked PR - #910

Merged
ngm merged 1 commit into
developfrom
fix/stub-geocoder-test-forks
Sep 23, 2026
Merged

ngm merged 1 commit into
developfrom
fix/stub-geocoder-test-forks

Conversation

@edwh

@edwh edwh commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #908, which introduced this.

On forked PRs CircleCI has no GOOGLE_API_CONSOLE_KEY, so the setup step writes GEOCODER_STUB=true into .env. testStubIsOffUnlessDeliberatelyEnabled then asserted the live config was false, so it failed on precisely the runs the stub exists for. This is the only PHPUnit failure on #906 (build 5844: 568 tests, 1 failure), and #900 will hit it too once it merges develop.

The test now reads config/restarters.php's default with GEOCODER_STUB cleared, which is the actual production property. A new testStubCanBeEnabled checks the other direction, so the default check can't pass vacuously.

Checked locally by booting the app with GEOCODER_STUB=true in .env: the live config was true (so the old assertion would fail), the cleared default was false, and GEOCODER_STUB=true gave true. The full suite hasn't been run locally; CI on this PR is the gate.

🤖 Generated with Claude Code

CI writes GEOCODER_STUB=true into .env when it has no geocoding key,
which is every forked PR. The test asserted the live config was false,
so it failed on exactly the runs the stub exists for (#906 build 5844).

Check the config file's default with the variable cleared instead, and
add the converse so the default check can't pass vacuously.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@ngm
ngm merged commit 7d7c93d into develop Sep 23, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants