-
Notifications
You must be signed in to change notification settings - Fork 113
HelpersTask597_Configure_Codecov_for_coverage #598
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
Some comments.
dev_scripts_helpers/update_devops_packages/notebooks/Master_buildmeister_dashboard.ipynb
Outdated
Show resolved
Hide resolved
dev_scripts_helpers/update_devops_packages/notebooks/Master_buildmeister_dashboard.ipynb
Outdated
Show resolved
Hide resolved
dev_scripts_helpers/update_devops_packages/notebooks/Master_buildmeister_dashboard.py
Show resolved
Hide resolved
…b.com:causify-ai/helpers into HelpersTask597_Configure_Codecov_for_coverage
…b.com:causify-ai/helpers into HelpersTask597_Configure_Codecov_for_coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
Some questions and comments.
I'd propose to make a doc with a pipeline explanation.
For readers and users with zero coverage
and Codecov
experience will be hard to figure out.
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change it to submodules: recursive
to prepare for using it as a reusable workflow.
# Scheduled for Monday (i.e Day 1) or when manually triggered. | ||
if: (github.event_name == 'schedule' && env.DAY_OF_WEEK == '1') || github.event_name == 'workflow_dispatch' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking a bit hackish. Let's add a TODO to consider removing it when we turn this workflow into a reusable one.
run: invoke run_superslow_coverage . | ||
|
||
- name: Upload Superslow Test Coverage to Codecov | ||
if: (github.event_name == 'schedule' && env.DAY_OF_WEEK == '1') || github.event_name == 'workflow_dispatch' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd not duplicate the if
here, just use
https://stackoverflow.com/questions/60453924/running-a-github-actions-step-only-if-previous-step-has-run
Something like:
- name: Build app
id: build
run: |
<build command>
- name: Run tests
- name: Create artifact of test coverage
if: steps.build.outcome == 'success'
""" | ||
Run coverage for a given suite (fast/slow/superslow). | ||
|
||
:param suite: one of "fast" or "slow" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add the superslow
also.
:param generate_html_report: whether to produce HTML output | ||
:return: xml file named 'coverage.xml' | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linter?
hlitauti.run(ctx, test_cmd, use_system=False) | ||
# Move the default ".coverage" file to our suite-specific filename. | ||
hsystem.system(f"mv .coverage {coverage_file}") | ||
hdbg.dassert_file_exists(coverage_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd check the existence of .coverage before renaming.
# Move the default ".coverage" file to our suite-specific filename. | ||
hsystem.system(f"mv .coverage {coverage_file}") | ||
hdbg.dassert_file_exists(coverage_file) | ||
# Compute which files/dirs to include and omit in the report. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm lost. What report do you meant here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably it worth to split the pipeline to blocks with comments.
report_cmd: List[str] = [ | ||
# Clear out any prior coverage data. | ||
"coverage erase", | ||
# Combine this suite's data into the coverage database. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I'm puzzled. Why we need it?
# Export XML coverage report. | ||
report_cmd.append("coverage xml -o coverage.xml") | ||
full_report_cmd: str = " && ".join(report_cmd) | ||
docker_cmd_ = f"invoke docker_cmd --use-bash --cmd '{full_report_cmd}'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dumb question: why we need to run it inside the Docker container?
return include_in_report, exclude_from_report | ||
|
||
|
||
def _run_coverage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we promote it to an invoke target and get rid of:
- run_fast_coverage
- run_slow_coverage
- run_superslow_coverage
WDYT?
Issue: #597