Skip to content

test: Remove all-lint.py script - #29228

Merged
achow101 merged 2 commits into
bitcoin:masterfrom
maflcko:2401-test-rm-wrap-wrap-
Jan 18, 2024
Merged

achow101 merged 2 commits into
bitcoin:masterfrom
maflcko:2401-test-rm-wrap-wrap-

Conversation

@maflcko

@maflcko maflcko commented Jan 11, 2024 •

Copy link
Copy Markdown
Member

Seems confusing to have a test runner that calls another runner (all-lint.py), which calls a subset of the lint tests.

Fix that by just calling this subset of lint tests in the test runner directly, and remove the now unused all-lint.py.

To run all lint checks locally, refer to the documentation: https://github.com/bitcoin/bitcoin/blob/master/test/lint/README.md#running-locally

@DrahtBot

DrahtBot commented Jan 11, 2024 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK TheCharlatan, kevkevinpal, pablomartin4btc, brunoerg, achow101

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the Tests label Jan 11, 2024
@kevkevinpal

Copy link
Copy Markdown
Contributor

looks like we can replace the comment to run all the lint commands

we can swap this
test/lint/all-lint.py
for
test/lint/lint-*.py

@hebasto

hebasto commented Jan 14, 2024

Copy link
Copy Markdown
Member

Seems confusing to have a test runner that calls another runner (all-lint.py), which calls a subset of the lint tests.

However, it is quite convenient to run ./test/lint/all-lint.py locally, no?

@maflcko

maflcko commented Jan 15, 2024

Copy link
Copy Markdown
Member Author

Seems confusing to have a test runner that calls another runner (all-lint.py), which calls a subset of the lint tests.

However, it is quite convenient to run ./test/lint/all-lint.py locally, no?

Why would it be convenient, when it is called "all-lint", but at the same time skips checks such as the fs check, the subtree check, and the doc check?

@torkelrogstad

Copy link
Copy Markdown
Contributor

However, it is quite convenient to run ./test/lint/all-lint.py locally, no?

Chiming in as a very inexperienced contributor that has been bashing against CI linter failures: I would say it's very nice to have an easy way to run all tests and checks locally before pushing. The correct thing to do here would be to expand the linter script to include more of the checks, IMO.

On a slightly related note: it would also be nice to include either instructions or CLI flags that fix linter complaints, where possible. I had issues with getting the whitespace linter to pass, and couldn't find any Makefile target, script or similar to automatically format my Python code.

@maflcko

maflcko commented Jan 15, 2024

Copy link
Copy Markdown
Member Author

The correct thing to do here would be to expand the linter script to include more of the checks, IMO.

If you want to run all checks locally, you can refer to the documentation (https://github.com/bitcoin/bitcoin/blob/master/test/lint/README.md#running-locally). The options include running them in a docker container, or via the test_runner.

I am happy to close this pull, but all-lint.py never was a way to run "all" lint checks (the above mentioned were always excluded) and given that there are options to run all, I don't see its value, but maybe I am missing something.

@maflcko

maflcko commented Jan 15, 2024

Copy link
Copy Markdown
Member Author

I had issues with getting the whitespace linter to pass, and couldn't find any Makefile target, script or similar to automatically format my Python code.

I think you can use any automated formatter of your choice. For example black (for a file that was written fully fresh), or yapf-diff (see the docs in this repo), or any other automated formatter.

@sedited

sedited commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

Concept ACK

MarcoFalke added 2 commits January 16, 2024 10:54
Can be reviewed with --color-moved=dimmed-zebra
@maflcko
maflcko force-pushed the 2401-test-rm-wrap-wrap- branch from fa9094a to fa2b95c Compare January 16, 2024 09:56
@maflcko

maflcko commented Jan 16, 2024

Copy link
Copy Markdown
Member Author

looks like we can replace the comment to run all the lint commands

Thanks, added a commit to move the documentation to one place.

@brunoerg

Copy link
Copy Markdown
Contributor

I use all-lint.py frequently, it's convenient even not running all lints de facto. However, since there is other way to achieve the same and it's documentated, Concept ACK on removing it.

@sedited sedited left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK fa2b95c

@DrahtBot
DrahtBot requested a review from brunoerg January 17, 2024 17:41
@kevkevinpal

Copy link
Copy Markdown
Contributor

ACK fa2b95c

@pablomartin4btc pablomartin4btc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

tACK fa2b95c

I also used to run the all-int.py but I've tried the docker linter locally following the instructions from the link provided in the description of the PR and I'll use that going forward.

DOCKER_BUILDKIT=1 docker build -t bitcoin-linter --file "./ci/lint_imagefile" ./ && docker run --rm -v $(pwd):/bitcoin -it bitcoin-linter
[+] Building 169.7s (12/12) FINISHED                                                                               docker:default
 => [internal] load build definition from lint_imagefile                                                                     0.1s
 => => transferring dockerfile: 708B                                                                                         0.0s
 => [internal] load .dockerignore                                                                                            0.1s
 => => transferring context: 2B                                                                                              0.0s
 => [internal] load metadata for docker.io/library/debian:bookworm                                                           2.9s
 => [1/7] FROM docker.io/library/debian:bookworm@sha256:b16cef8cbcb20935c0f052e37fc3d38dc92bfec0bcfb894c328547f81e932d67     3.3s
 => => resolve docker.io/library/debian:bookworm@sha256:b16cef8cbcb20935c0f052e37fc3d38dc92bfec0bcfb894c328547f81e932d67     0.0s
 => => sha256:b16cef8cbcb20935c0f052e37fc3d38dc92bfec0bcfb894c328547f81e932d67 1.85kB / 1.85kB                               0.0s
 => => sha256:d1fbb74d3e14bce3a324a08c0e89ba99285c28a6886c295871d86f853e1821fc 529B / 529B                                   0.0s
 => => sha256:a6916e41aa871b09260f8949fe3c34570719f1c92ffe87d515b7eb702ebaebb1 1.46kB / 1.46kB                               0.0s
 => => sha256:1b13d4e1a46e5e969702ec92b7c787c1b6891bff7c21ad378ff6dbc9e751d5d4 49.56MB / 49.56MB                             2.0s
 => => extracting sha256:1b13d4e1a46e5e969702ec92b7c787c1b6891bff7c21ad378ff6dbc9e751d5d4                                    1.0s
 => [internal] load build context                                                                                            0.1s
 => => transferring context: 6.78kB                                                                                          0.0s
 => [2/7] COPY ./.python-version /.python-version                                                                            0.1s
 => [3/7] COPY ./ci/lint/container-entrypoint.sh /entrypoint.sh                                                              0.1s
 => [4/7] COPY ./ci/lint/04_install.sh /install.sh                                                                           0.1s
 => [5/7] COPY ./test/lint/test_runner /test/lint/test_runner                                                                0.1s
 => [6/7] RUN /install.sh &&   echo 'alias lint="./ci/lint/06_script.sh"' >> ~/.bashrc &&   chmod 755 /entrypoint.sh &&    155.6s
 => [7/7] WORKDIR /bitcoin                                                                                                   0.1s
 => exporting to image                                                                                                       7.2s 
 => => exporting layers                                                                                                      7.2s 
 => => writing image sha256:ab4f85fd71350e3f776adb68c125f862111e3c19ce6e9a3cacdf05202a2c4fac                                 0.0s 
 => => naming to docker.io/library/bitcoin-linter                                                                            0.0s 
+ '[' -n 1 ']'                                                                                                                    
++ git merge-base HEAD master
+ COMMIT_RANGE=c2d04f1319a6af6140d17339c4814e0cfc605dd2..HEAD
+ export COMMIT_RANGE
+ RUST_BACKTRACE=1
+ /lint_test_runner/test_runner
src/crypto/ctaes in HEAD currently refers to tree 1b6c31139a71f80245c09597c343936a8e41d021
src/crypto/ctaes in HEAD was last updated in commit 8501bedd7508ac514385806e191aec21ee978891 (tree 1b6c31139a71f80245c09597c343936a8e41d021)
GOOD
src/secp256k1 in HEAD currently refers to tree 4f5d0a37a5ce94a773267b04af331b5f680b0433
src/secp256k1 in HEAD was last updated in commit 29fde0223abc706925188014209eba75390a9df8 (tree 4f5d0a37a5ce94a773267b04af331b5f680b0433)
GOOD
src/minisketch in HEAD currently refers to tree a749309e1b4edf48091edb57da6de2e8a16498a5
src/minisketch in HEAD was last updated in commit e9f1d8c27261070d209a28570ad36fe91531cdd2 (tree a749309e1b4edf48091edb57da6de2e8a16498a5)
GOOD
src/leveldb in HEAD currently refers to tree bd49d3c60051c1a8d8f030fa4ba7a29237fe7479
src/leveldb in HEAD was last updated in commit 1a463c70a368fb20316e03efac273438cf47baa3 (tree bd49d3c60051c1a8d8f030fa4ba7a29237fe7479)
GOOD
src/crc32c in HEAD currently refers to tree 5a1b5f7188bd2181e2a71d431fff282d50058e46
src/crc32c in HEAD was last updated in commit 08269e54a9a74e06c9fb72720a216d8c4d4532a2 (tree 5a1b5f7188bd2181e2a71d431fff282d50058e46)
GOOD
Args used        : 209
Args documented  : 220
Args undocumented: 0
set()
Args unknown     : 11
{'-zmqpubhashblockhwm', '-zmqpubsequence', '-zmqpubrawtxhwm', '-zmqpubhashtx', '-zmqpubrawblock', '-zmqpubrawblockhwm', '-zmqpubrawtx', '-zmqpubsequencehwm', '-zmqpubhashtxhwm', '-includeconf', '-zmqpubhashblock'}
src/test/fuzz/package_eval.cpp:214: non-existant ==> non-existent
src/test/span_tests.cpp:56: memeber ==> member
^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in test/lint/spelling.ignore-words.txt
Success: no issues found in 280 source files
+ '[' '' = bitcoin/bitcoin ']'

@brunoerg brunoerg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

utACK fa2b95c

@achow101

Copy link
Copy Markdown
Member

ACK fa2b95c

@achow101
achow101 merged commit ac3901e into bitcoin:master Jan 18, 2024
@maflcko
maflcko deleted the 2401-test-rm-wrap-wrap- branch January 18, 2024 18:03
@bitcoin bitcoin locked and limited conversation to collaborators Jan 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants