chore: Add JUnit XML output to pytest and publish test results to PRs#566
Conversation
Co-Authored-By: Aaron <AJ> Steers <aj@airbyte.io>
|
Original prompt from Aaron: |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…y check name Co-Authored-By: Aaron <AJ> Steers <aj@airbyte.io>
PyTest Results (Fast)3 655 tests 3 645 ✅ 5m 42s ⏱️ Results for commit 1439d1f. ♻️ This comment has been updated with latest results. |
Co-Authored-By: Aaron <AJ> Steers <aj@airbyte.io>
PyTest Results (Full)3 658 tests 3 648 ✅ 17m 6s ⏱️ Results for commit 1439d1f. ♻️ This comment has been updated with latest results. |
Maxime Carbonneau-Leclerc (maxi297)
left a comment
There was a problem hiding this comment.
This change makes sense to me so I'll approve!
On another note and outside of scope, I did learn when reviewing that we had CI for fast tests and all tests. Is this really necessary? It feels like when tests are executed in the CI, we probably always want to run everything. If we agree on this, I'm wondering if we can simplify workflow stuff.
Maxime Carbonneau-Leclerc (@maxi297) - The benefit of the fast-test being separate is that it returns results much faster than the full test suite. 90% of failures can be found within 2-5 minutes, saving the 18-20 minutes wait to catch the other 10%. Also, fast-tests return immediately if any tests fail, speeding up iteration loops a lot. The problem I have with relying just on the standard "full" tests is that even when there's a failure in one of the early tests, the report doesn't report back until the full 18+ minutes-long suite has completed. The fast version not only skips 'slow' tests, but it also fast-fails. So "compile-type" issues and many other types of failures return immediately if any fail. If fast-tests fail, they fail fast so you can quickly fix the issue. If fast-tests succeed, it is very likely that the "full" tests will also succeed, so you have early high confidence after 5 minutes that the rest is fine. Without that, we really know nothing for 15-20 minutes unless we carefully trail the logs. 🙈 That said - I don't feel very strongly about having them both create comments or both creating check status. We can clearly see a failure in the PR checks status if needed, and in most cases, the results will be same/similar between the two. 🤷 If two comments is too much, we can remove one and probably still have it create a check status. If anything, I might lean towards the fast tests being "primary", since the extra fifteen minutes runtime only gives 3 more test results (if the above summaries are correct). |
ad1184f
into
main
Note from AJ (Aaron ("AJ") Steers (@aaronsteers))
Maxime Carbonneau-Leclerc (@maxi297) and Ben Church (@bnchrch) - This follows from the similar changes made for Airbyte connectors recently.
I wanted to carry this pattern also to PyAirbyte and CDK. PyAirbyte PR implementing the same is here:
Note:
pytestini settings inpyproject.tomlwere being ignored because of the presence of thepytest.inifile. So, I've removed this section frompyproject.toml, with a comment noting that the settings are moved topytest.ini.Add JUnit XML output to pytest and publish test results to PRs
Description
This PR adds JUnit XML output to the pytest configuration in airbyte-python-cdk and adds a post-run step in the GitHub Actions workflow to publish test results back to PRs, similar to the implementation in the PyAirbyte repository.
Changes
--junit-xml=build/test-results/test-results.xmlto the pytest configuration inpyproject.tomlEnricoMi/publish-unit-test-result-action@v2step to publish test results in the following workflows:Testing
Link to Devin run
https://app.devin.ai/sessions/8c3fcd54a4e2406fa92ab027c447da9b
Requested by
Aaron ("AJ") Steers (aj@airbyte.io)
Important
Auto-merge enabled.
This PR is set to merge automatically when all requirements are met.