test: run each integration test class against a fresh Connect container - #486
test: run each integration test class against a fresh Connect container#486cgraham-rs wants to merge 1 commit into
Conversation
Provisions a fresh, disposable Connect container per test class via a class-scoped autouse fixture wrapping with-connect, so state can never leak between test classes (#460). Container lifecycle (including cleanup on incomplete with-connect output) is now owned by pytest instead of the Makefile. Also dedupes the OAuth default-integration cleanup into a scoped conftest.py under oauth/, updates CI to write the license file directly and drop the composite with-connect action, and documents the new integration test workflow in integration/README.md.
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
|
@tdstein Beyond looking at the PR changes here I also hit a lint error in CI that was not evident locally. It looks like CI pulled a different version of
|
tdstein
left a comment
There was a problem hiding this comment.
This is so great. Thank you so much for putting in the effort to make this happen. What are your thoughts on utilizing this pattern more for doing end-to-end integration testing as part of the Connect CI workflow. That's always been part of the mission here, but it hasn't materialized.
Also, I know there is a bunch of logic in the integration tests that does manually cleanups to make things work between tests. I can delete all of that now, right?
There was a problem hiding this comment.
Gah! This is so cool. Sometime I just absolutely love Python!
| os.environ["CONNECT_SERVER"] = creds["CONNECT_SERVER"] | ||
| os.environ["CONNECT_API_KEY"] = creds["CONNECT_API_KEY"] | ||
| yield |
Yeah, that keeps causing headaches. Is the fix to simply commit |
I think that is the correct fix. But the fact it's been gitignored for so long gives me pause as there must have been a reason to do that. But that reason was not clear. I created two new issues so we can track and work on those separately. |
I'm not sure what you mean.
The fresh Connect change is scoped to test classes, not individual tests. The tests within the same class still share one container, so one test's leftover state can still affect a sibling test in that same class. So we will still have to manage that, like we did with the oauth tests in this PR. |
|
IMO we should merge this even though there are lint failures. Those are external to the changes here and are tracked separately. |
Fixes #460
with-connectso state can never leak between test classesconftest.pyfixture underoauth/with-connectactionintegration/README.md