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

update workflows and unit tests #84

Merged
merged 4 commits into from
Feb 23, 2024
Merged

update workflows and unit tests #84

merged 4 commits into from
Feb 23, 2024

Conversation

2bndy5
Copy link
Contributor

@2bndy5 2bndy5 commented Feb 22, 2024

now uses the following reusable workflows:

  • pre-commit.yml
  • py-coverage.yml

Adjusting Unit tests

  • codecov-action v4 now requires a CODECOV token (which I added to repo secrets)
  • test_download_file was passing unexpectedly (should have expectedly failed for "latest" release_tag).
  • test_path_warning wouldn't pass when run in a venv (which is how I run tests locally).
  • test_get_sha was using outdated sha512sum for Windows.
  • CI now runs unit tests on all 3 OS and the reusable workflow will combine coverage data for the coverage reports.
  • test_install_tools does not need to download every supported version of clang-tidy and clang-format. By only downloading v12 of clang-format, we get the same coverage and faster test runtime across all platforms. Note: the CI has a separate job matrix to install and invoke all supported versions of clang-tidy and clang-format.
  • added new test_is_installed to trigger lines that surmount to "tool is not installed" condition. This is just done to improve code coverage.

pre-commit

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.92%. Comparing base (848711e) to head (447dc6e).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #84      +/-   ##
==========================================
+ Coverage   87.71%   95.92%   +8.20%     
==========================================
  Files           4        7       +3     
  Lines         171      270      +99     
==========================================
+ Hits          150      259     +109     
+ Misses         21       11      -10     

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

@2bndy5
Copy link
Contributor Author

2bndy5 commented Feb 22, 2024

[coverage] Report is 12 commits behind head on main.

We should have picked up on this earlier. Last report was uploaded for 848711e. I don't know why it stopped uploading coverage reports, but this PR seems to fix that now.

@2bndy5 2bndy5 requested a review from shenxianpeng February 22, 2024 23:55
@2bndy5 2bndy5 force-pushed the reusable-coverage branch 2 times, most recently from 3d1b2e2 to 389bb37 Compare February 23, 2024 03:03
now uses the following reusable workflows:
- pre-commit.yml
- py-coverage.yml

## Adjusting Unit tests
- codecov-action v4 now requires a CODECOV token (which I added to repo secrets)
- `test_download_file` was passing unexpectedly (should have expectedly failed for `"latest"` release_tag).
- `test_path_warning` wouldn't pass when run in a venv (which is how I run tests locally).
- `test_get_sha` was using outdated sha512sum for Windows.
- CI now runs unit tests on all 3 OS and the reusable workflow will combine coverage data for the coverage reports.
makes better use of stubs in the same file
uses ruff for linting and formatting in a pre-commit hook

also ran ruff on all python files for correctness
now includes test code in coverage

does not download every supported version just to trigger lines in coverage data; only 1 version will suffice.

only download clang-format when testing `install_tool()` because it gets same coverage and downloads faster on all supported platforms.
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@2bndy5 2bndy5 merged commit ed7a981 into main Feb 23, 2024
49 checks passed
@2bndy5 2bndy5 deleted the reusable-coverage branch February 23, 2024 05:46
@shenxianpeng shenxianpeng added the enhancement New feature or request label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants