Repository navigation
ci: Add test-each-commit task - #28279
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
05c57bc to
9656b0b
Compare
|
Will squash if there is conceptual agreement (Not sure when this concept last came up, but I think @dergoegge and @achow101 mentioned it?). Review question: Looks like the worst-case runtime is 1 hour per commit, so with GHA at most 6 commits could be tested before a timeout. Maybe a self-hosted worker with a longer timeout would be better? |
|
Concept ACK
Probably but I am wondering a bit if these task could end up clogging our self-hosted worker queue and hinder other jobs from running in their regular time? |
Right, that is another reason for self-hosted runners, because it is possible to assign a label to them, so that they are task-specific, and not interfere with other tasks. On GHA "free" runners will stop being spun up after n total parallel running tasks. |
|
This would be a cirrus self-hosted worker though, right? |
|
Concept ACK if our CI infra can handle it. I build and run the unit tests on each commit for more critical pulls, or pulls with commits that aren't clearly separate or that look interactive, or those with many commits, but often without also running the functional tests that take longer to run. Having the CI verify this would alert PR authors more quickly and save developer time for everyone. |
That said, what my build+test checks most often find is a failing build before running any tests. So if infra resources are limited, just build (or build + units) might still catch most of the issues. |
9656b0b to
fa568b4
Compare
|
I think it is fine to use GHA for now, with a limit of 6 commits. This should cover 99% of all pull requests. If there is a need for a self-hosted runner, it can trivially be added later. |
fae902e to
fac0220
Compare
|
Concept ACK.
I've encountered such cases during my reviews. |
|
Sure, but as I said, we can use self-hosted runners if and when there is a need. This check will take a few seconds on pulls with one commit (I can reduce this, if needed), which should be the most common type of pull request. Also, there is a limit of 6 hours, so this should be fine as well, unless many pull requests with many commits are pushed to at the same time, in which case there likely is a backlog either way. |
Compile each commit locally, I guess? See the existing docs on how to do that. |
Yes, it is what is expected from a developer in first place before they push their branch. But if we add a CI task that tests every commit, it is reasonable, at least for me, to expect it prints a commit hash being tested somewhere. |
fac0220 to
faed0f4
Compare
hebasto
left a comment
There was a problem hiding this comment.
ACK faed0f4ed43e9416eb0620db1943c9ae083a5b50
jonatack
left a comment
There was a problem hiding this comment.
utACK faed0f4ed43e9416eb0620db1943c9ae083a5b50
faed0f4 to
fa5356c
Compare
|
Small fixup to remove the unused/disabled |
| env: | ||
| MAX_COUNT: '--max-count=6' | ||
| steps: | ||
| - uses: actions/checkout@v3 |
There was a problem hiding this comment.
Yes, can be done on the next force push or in the other pull.
There was a problem hiding this comment.
#28402 has been merged; it's not clear to me if this ought to be updated to v4.
There was a problem hiding this comment.
Ah sorry, I forgot it was already merged.
I don't think v3 or v4 are any different, so I'll follow-up with this style nit later.
| - run: sudo apt install ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y | ||
| - run: EDITOR=true git rebase --interactive --exec "./autogen.sh && CC=clang CXX=clang++ ./configure && make clean && make -j $(nproc) check && ./test/functional/test_runner.py -j $(( $(nproc) * 2 ))" $( git log --merges -1 --format='%H' ) | ||
| - run: sudo apt install clang ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y | ||
| # Use clang++, because it is a bit faster and uses less memory than g++ | ||
| - run: git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && ./autogen.sh && CC=clang CXX=clang++ ./configure && make clean && make -j $(nproc) check && ./test/functional/test_runner.py -j $(( $(nproc) * 2 ))" "$( git log '^'$( git log --merges -1 --format='%H' ) HEAD --format='%H' ${MAX_COUNT} | tail -1 )~1" |
There was a problem hiding this comment.
Why don't combine unrelated to MAX_COUNT changes into the previous commit?
There was a problem hiding this comment.
For review, it may be better to just look at the overall changes. There are two commits, so that the CI can be observed working.
|
rfm or is there anything left to be done here? |
ACK fa5356c Modulo one question in #28279 (comment). |
|
Looks like this is currently failing for new PRs: https://github.com/bitcoin/bitcoin/actions/runs/6184007676/job/16786866270?pr=28476 Run git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && ./autogen.sh && CC=clang CXX=clang++ ./configure && make clean && make -j $(nproc) check && ./test/functional/test_runner.py -j $(( $(nproc) * 2 ))" "$( git log '^'$( git log --merges -1 --format='%H' ) HEAD --format='%H' ${MAX_COUNT} | tail -1 )~1"
fatal: invalid upstream '~1'
Error: Process completed with exit code 128. |
|
I guess the issue is that Not sure why, because locally it works: |
fa2cb2f Revert "Merge bitcoin/bitcoin#28279: ci: Add test-each-commit task" (MarcoFalke) Pull request description: This should unbreak the GHA CI for now, and allow someone to fix the task in a follow-up. The issue is bitcoin/bitcoin#28279 (comment) . If no one fixes it, it can be replaced by a Cirrus CI self-hosted runner. ACKs for top commit: sipa: ACK fa2cb2f dergoegge: ACK fa2cb2f Tree-SHA512: d9c70915b3fb676f44054cee8033286910682ff6819d4ee71e432f7efb3043a0a9507f0052b6c24e3b0c431875f6337b1adccc5b48432970d7c29c6d6b00a2d7
fa5356c ci: Limit test-each-commit to --max-count=6 (MarcoFalke) fafcd2e ci: Add test-each-commit task (MarcoFalke) Pull request description: Currently, if a pull request has more than one commit, previous commits may fail to compile, or may fail the tests. This is problematic, because it breaks git-bisect, or worse. Fix this by adding a CI task for this. ACKs for top commit: jonatack: ACK fa5356c dergoegge: utACK fa5356c hebasto: ACK fa5356c Tree-SHA512: 304eff5545501ee499b881f0b0a0c1fe32a7c9f00d96b45bba731af08ac5ca917cef223f5c3d346e30c11a3e6e12e1da297929d3caea9644f3ec1de25dd97c37
27b636a ci: Reintroduce fixed "test-each-commit" job (Hennadii Stepanov) Pull request description: This is a fixed version of #28279: > Currently, if a pull request has more than one commit, previous commits may fail to compile, or may fail the tests. This is problematic, because it breaks git-bisect, or worse. > > Fix this by adding a CI task for this. The new job checks at most 6 commits of a pull request, excluding the top one. The maximum number of tested commits is 6, which derives from the time [constrains](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes). For historical context, please see: - #28279 - #28477 - #28478 **A note for reviewers:** To test scripts locally, ensure that you works with a _shallow_ copy of the repo. ACKs for top commit: MarcoFalke: lgtm ACK 27b636a Tree-SHA512: 0c69ced13509fa0ed2dd6ef13f4c710d678e31b294b6318b59ab1ba899086a71b5c893aaf70e143036349329167bf8e16bdca319b2c761e2aef6222d0db1470c
27b636a ci: Reintroduce fixed "test-each-commit" job (Hennadii Stepanov) Pull request description: This is a fixed version of bitcoin#28279: > Currently, if a pull request has more than one commit, previous commits may fail to compile, or may fail the tests. This is problematic, because it breaks git-bisect, or worse. > > Fix this by adding a CI task for this. The new job checks at most 6 commits of a pull request, excluding the top one. The maximum number of tested commits is 6, which derives from the time [constrains](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes). For historical context, please see: - bitcoin#28279 - bitcoin#28477 - bitcoin#28478 **A note for reviewers:** To test scripts locally, ensure that you works with a _shallow_ copy of the repo. ACKs for top commit: MarcoFalke: lgtm ACK 27b636a Tree-SHA512: 0c69ced13509fa0ed2dd6ef13f4c710d678e31b294b6318b59ab1ba899086a71b5c893aaf70e143036349329167bf8e16bdca319b2c761e2aef6222d0db1470c
This reverts commit 744e0e36703e26d06bc5cd1ef36a1c8568e71d05, reversing changes made to 8209e86eeb4ceb6dd0e06c45fb3c799bb42834ab.
Currently, if a pull request has more than one commit, previous commits may fail to compile, or may fail the tests. This is problematic, because it breaks git-bisect, or worse.
Fix this by adding a CI task for this.