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

ci: fix a test and update CI to catch errors regularly #199

Merged
merged 6 commits into from
Jun 10, 2022

Conversation

Saransh-cpp
Copy link
Member

@Saransh-cpp Saransh-cpp commented May 31, 2022

  • Fixed a numerical error in tests (no idea how it came into existence suddenly, a change in the upstream repositories?)
  • Added a cron job to CI
  • Added workflow_dispatch to CI
  • CI now cancels or skips intermediate builds
  • Added steps to generate and upload coverage report

* Fix a numerical error in tests
* Add a cron job to CI
* Add workflow_dispatch to CI
* Allow CI to cancel or skip intermediate builds
@Saransh-cpp
Copy link
Member Author

Should I check the python version and assert different values based on it? Or is there a better way to fix this?😅

@Saransh-cpp Saransh-cpp force-pushed the saransh/failing-ci branch from 8b740da to d8a6d36 Compare June 6, 2022 10:01
@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2022

Codecov Report

❗ No coverage uploaded for pull request base (main@c826c63). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #199   +/-   ##
=======================================
  Coverage        ?   82.44%           
=======================================
  Files           ?       96           
  Lines           ?    10386           
  Branches        ?        0           
=======================================
  Hits            ?     8563           
  Misses          ?     1823           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c826c63...77b81df. Read the comment docs.

@Saransh-cpp
Copy link
Member Author

The coverage currently is not visible on Codecov. The link gives a "Sorry, we couldn't find that page" error, but the cause of this might be the absence of a reference (main branch) coverage report?

@Saransh-cpp Saransh-cpp requested review from jpivarski and henryiii June 6, 2022 17:06
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkmark from me; adding Codecov is a good idea. I'm not sure that the tests need to run every day, but I'm not against it.

Comment on lines 9 to 10
schedule:
- cron: '0 2 * * *' # Daily at 2 AM UTC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it really need to run every day? What, outside of this repo, changes in a way that we want to be alerted about?

Copy link
Member Author

@Saransh-cpp Saransh-cpp Jun 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think of it, maybe not. I added a cron job as this particular failure was detected by the pre-commit bot, and it would have gone unnoticed if there were no PRs, but such errors will not result in vector not functioning for users. Should I revert this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's not a reason for it, yeah. No reason to use GitHub's compute time needlessly.

@Saransh-cpp
Copy link
Member Author

Should I (squash and) merge this PR? (A general query - should I merge PRs after they are approved, or will it be performed by the maintainers? Also, should I wait for both approvals, or will one suffice to make it ready for merging?)

@henryiii
Copy link
Member

henryiii commented Jun 10, 2022

I'm fine with one approval. I'd say "anyone can merge once we get one approval (as long as the approver is not the PR author)". Really small PRs like a tiny bug fix can be merged without review if you'd like.

@henryiii
Copy link
Member

(This is the sort of thing I like, so I'm reviewing it too now)

setup.py Outdated
@@ -10,6 +10,7 @@
"awkward": ["awkward>=1.2.0"],
"test": [
"pytest>=4.6",
"pytest-cov==3.0.0",
Copy link
Member

@henryiii henryiii Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be pinned this tightly. Maybe cap at <4; leaving uncapped is fine too. Also we should go ahead and make pytest>=6 while we are at it. (In fact, given

[tool.pytest.ini_options]
- we already require pytest 6 or better)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for linking the blog! Amazing read! Never thought about capping so much :)

}
],
]
assert out.tolist()[0][0] == pytest.approx(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if I knew approx worked on a dict. :) Anyway, this now doesn't test completeness, this would now pass if there was one more item. Maybe

(a, b, c), = out.to_list(), then check a, b and c?

Copy link
Member

@henryiii henryiii Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I think I read that wrong, I think it's (a,), b, (c,) =. Or you could even do (a,), (), (c,) = which will check the emptiness of the second list for you.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, thanks!

@Saransh-cpp Saransh-cpp merged commit cf4c71a into scikit-hep:main Jun 10, 2022
@Saransh-cpp Saransh-cpp deleted the saransh/failing-ci branch June 10, 2022 15:02
@Saransh-cpp Saransh-cpp added this to the v0.9.0 milestone Feb 17, 2023
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.

4 participants