Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emit junit results in a monorepo-friendly way #1231

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

matt-codecov
Copy link
Contributor

@matt-codecov matt-codecov commented Mar 21, 2025

see resulting test file paths here: https://app.codecov.io/gh/codecov/codecov-api/tests/matt%2Fmonorepo-friendly-junit

sort by "Last run" to get the results of the most recent attempt

this is a bit of a hack, but better solutions are all way, way easier after cutover and involve more invasive changes to how things work.

the worker/shared/api PRs pass --rootdir=${PYTEST_ROOTDIR} -c pytest.ini to pytest invocations. --rootdir=${PYTEST_ROOTDIR} allows us to override the rootdir, and -c pytest.ini makes sure pytest can still find its config when we do.

by default, the rootdir is ., which is the directory pytest.ini lives in. it's as if neither argument were passed at all. the original worker/api/shared repos use the default, so they are unchanged.

the gha-workflows PR adds an optional input to the test workflows which allow PYTEST_ROOTDIR to be overridden. umbrella passes in /app, and the result is that test file paths inside junit.xml will have the prefix umbrella wants (e.g. apps/worker for worker).

so, the original repositories generate junit files with test file paths relative to the repo root, just like always. and umbrella will generate junit files with test file paths relative to umbrella's root, which is what umbrella wants.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Copy link
Contributor

✅ Sentry found no issues in your recent changes ✅

Copy link

codecov bot commented Mar 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.31%. Comparing base (8b67765) to head (9320511).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1231   +/-   ##
=======================================
  Coverage   96.31%   96.31%           
=======================================
  Files         492      492           
  Lines       16805    16805           
=======================================
  Hits        16185    16185           
  Misses        620      620           
Flag Coverage Δ
unit 96.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link

codecov-notifications bot commented Mar 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@matt-codecov matt-codecov force-pushed the matt/monorepo-friendly-junit branch 3 times, most recently from 546d4ba to 6e926da Compare March 21, 2025 01:20
@matt-codecov matt-codecov requested a review from a team March 21, 2025 01:49
@matt-codecov matt-codecov marked this pull request as ready for review March 21, 2025 01:49
@matt-codecov matt-codecov force-pushed the matt/monorepo-friendly-junit branch 2 times, most recently from 0db82ae to 660197e Compare March 21, 2025 17:44
@matt-codecov matt-codecov force-pushed the matt/monorepo-friendly-junit branch from 660197e to 9320511 Compare March 21, 2025 17:46
@matt-codecov matt-codecov enabled auto-merge March 21, 2025 17:47
@matt-codecov matt-codecov added this pull request to the merge queue Mar 21, 2025
Merged via the queue into main with commit 6e6d2be Mar 21, 2025
23 of 24 checks passed
@matt-codecov matt-codecov deleted the matt/monorepo-friendly-junit branch March 21, 2025 18:00
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