Afform Tests - Fix extension tests when run via civi-test-run
#18511
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The afform tests were previously run locally with a script
bin/test-all.sh
. They were recently added to thecivi-test-run
sequence for core test jobs, but the environment is slightly different.This involves two distinct changes.
Technical Details
Civi\Test::headless()->installMe()...
). This had a problem that wasn't apparent when running locally on a heady dev-build, but it does appear in a clean-environment -- i.e. it wasn't sufficiently aggressive in clearing theContainer
. In other extensions (e.g.flexmailer
andmosaico
), the test-suite specifically disables theContainer
cache to avoid this problem. But it's kind of annoying to remember to do this on all test-suites.never
.never
.angular
service-object. The Symfony Container allows this sometimes; but other times it doesn't.angular
service-object, but asks it do it its own (more fine-tuned) cache-clear.