-
Notifications
You must be signed in to change notification settings - Fork 162
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
Make test on every commit #3789
Make test on every commit #3789
Conversation
5a72c4a
to
8e6d93c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3789 +/- ##
=======================================
Coverage 17.51% 17.51%
=======================================
Files 3 3
Lines 805 805
=======================================
Hits 141 141
Misses 629 629
Partials 35 35 ☔ View full report in Codecov by Sentry. |
@christoph-zededa just to be sure: we already execute unit tests on every PR, but here you are proposing to execute them not just on every PR, but on every commit in the PR, right? |
Would be great to have this optional, so that everyone can decide does it make sense to run the whole test suite against each commit. This measure if it is a requirement looks more like a punishment for me. Testing is good, no doubts, but this is too much. |
Yes. |
It is already optional; (nearly) everybody can just run the same command on their machine. P.S.: Waiting for somebody to do the same for yetus ... |
@@ -396,6 +396,10 @@ test: $(LINUXKIT) test-images-patches | $(DIST) | |||
$(QUIET)$(DOCKER_GO) "cd \"$(GOTREE)\"; ../../tools/fuzz_test.sh" $(GOTREE) $(GOMODULE) | |||
$(QUIET): $@: Succeeded | |||
|
|||
test-commits: | |||
GIT_SEQUENCE_EDITOR=/bin/true git rebase -i --exec 'make test' origin/master |
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.
wow, this is a nice git command! didn't know something like this was possible 👍
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.
since unit tests already run on every push to any PR, I think most commits are already covered this way. I would leave it as is
I think for each commit it's a
I agree with @europaul . Also, I think it's nice to have the target |
Actually I don't think it is a good idea to have it in the Makefile; I would rather put the command directly into the github action. If you want to run it, you can just call |
@@ -20,6 +20,7 @@ import ( | |||
// TestPatchEnvelopes creates PatchEnvelope then deletes | |||
// one of them and checks of it was properly deleted | |||
func TestPatchEnvelopes(t *testing.T) { | |||
t.Skip("this test sporadically fails") |
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.
See #3792 I'm checking how it is running in runner, locally I ran it 300 times and didn't have any problems
I think it makes sense to have it locally also, because before publishing one can check if their commits don't break unit tests. Introducing it into CI/CD won't affect costs much, but I'd gather more data. Back of envelope calculations are like: on average it takes ~4 mins to run unit test on average we have ~5 commits per PR so it's additional 20 mins per PR. With Buildjet runners priced for 0.008$ per minute, it'll result in 0.16$ per PR on average. If we have around 60 PR per month (two each day) that will result in 9.6$ additional cost, I think we can live with that. As for process: we can always run it in parallel to other workflows :) |
Thank you very much for adding those numbers! |
FWIW we used to have a working 'make yetus' but it has fallen into disrepair. |
@uncleDecart I'm pretty sure each PR goes through multiple builds (updates to fix yetus issues, code review comments, rebase on master, etc). It is easy to extract how many e.g., yetus or unit test workflows we've run in a month so we can compare with how many PRs we did during that month? |
If I read everyone right we want to keep this in Makefile, but not to make this as a part of GH actions. @christoph-zededa can you please change this PR accordingly so we can merge? |
this new target runs go tests on every commit of a branch (relative to the master branch) Signed-off-by: Christoph Ostarek <christoph@zededa.com>
8e6d93c
to
a1adf81
Compare
done - please have a look at the change in the Makefile |
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.
Ack from me.
@christoph-zededa Please add the help line into the Makefile as well and let's merge this |
Closing as it seems nobody needs this |
Run
make test
on every commit of a PR.Advantages:
Disadvantages: