Add infra necessary to run API tests with specific server config#2468
Add infra necessary to run API tests with specific server config#2468acelaya wants to merge 2 commits intoshlinkio:developfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2468 +/- ##
=============================================
+ Coverage 93.61% 95.89% +2.27%
Complexity 1760 1760
=============================================
Files 279 279
Lines 6012 6012
=============================================
+ Hits 5628 5765 +137
+ Misses 384 247 -137 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
These changes seem to be working consistently in CI, but in my local dev env the tests are very flaky, or they even make other tests fail even if the env-specific tests pass. I'm still not sure what's the reason. It feels like something is "cached" and the wrong env vars are loaded, or perhaps it's a timing issue, although I have tried adding some Another thing that could be causing this is that an env var is set, and then reloading the server, even if the env vars file is no longer present, does not reset previously "promoted" env vars simply because the process is still running. I need to verify if this is the case. |
7773102 to
8892407
Compare
Part of #1009
Add necessary configuration to run API tests with a different server config, and one test using it as a proof of concept.
The process works as follows:
#[WithEnvVars([...])]attribute will cause the RoadRunner server to be restarted including the list of env vars.For this to work, this PR defines a PHPUnit extension that registers two listeners.