Skip to main content

Exonum deployment precheck script

exonum_precheck is a script which verifies that all the expected checks are OK for code you're about to push. It is supposed that you'll run this script before every push at the Exonum repository.

This command loads .travis.yml and performs all the checks (tests and lints) exactly as they will be performed on the CI server. Also if installed rustc version doesn't match the one in the travis config, a warning will be shown.

Prerequirements

You should have clippy, rustfmt, deadlinks, cspell and md installed:

cargo install cargo-deadlinks
rustup component add rustfmt
rustup component add clippy
npm install cspell
npm install md

Example

cd exonum_folder
python3 -m exonum_precheck

Example output (actually it's colored):

 Tests results:
 Error: cargo test --all
 Success: cargo run -p exonum --example explorer
 Success: cargo run -p exonum-testkit --example timestamping
 Success: cargo run -p exonum-time --example simple_service
 Lints results:
 Success: npm run cspell
 Success: npm run md
 Success: cargo clippy --all --benches --features "long_benchmarks"
 Success: cargo fmt --all -- --check
 Success: cargo clean --doc
 Success: cargo doc --no-deps
 Success: mkdir -p target/doc/exonum_configuration
 Success: mkdir -p target/std/string
 Success: touch target/std/string/struct.String.html
 Success: touch target/std/primitive.usize.html
 Success: touch target/doc/enum.HashTag.html
 Success: cargo deadlinks --dir target/doc

You can also specify jobs to run manually.

python3 -m exonum_precheck --jobs linux-tests sample-job lints tests

Those jobs will be executed instead of default ones ("unit-test", "lints") in the provided order.

This maybe helpful if you want to use this script on another repository.

Using as a git hook

This script can be also used as a prepush hook:

echo '#!/bin/sh\npython3 -m exonum_precheck || exit 1\n' > ./exonum_folder/.git/hooks/pre-push
chmod +x ./exonum_folder/.git/hooks/pre-push

With that hook you won't be able to push unless all the expected CI checks are passed. However, be careful: if you're going to work on a work-in-progress branch which'll have broken tests, you'll have to temporary remove the hook.

Example of more advanced hook:

#!/bin/sh
npm install && git checkout package-lock.json package.json

export RUST_BACKTRACE=0
export RUST_LOG=off
export RUST_TEST_THREADS=4
export CARGO_BUILD_JOBS=4
ulimit -n 2048

python3 -m exonum_precheck || exit 1

Installing

Install and update using pip:

pip install -U exonum_precheck

LICENSE

exonum_precheck is licensed under the MIT License. See LICENSE for details.

Metadata

Release files for exonum-precheck 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exonum-precheck 0.1.5
File Size Uploaded
exonum_precheck-0.1.5.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for exonum-precheck 0.1.5
File Interpreter ABI Platform
exonum_precheck-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / exonum_precheck-0.1.5.tar.gz

Download URL exonum_precheck-0.1.5.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
84835d678959bfd888f8bc8801af6d156e040e23685d3e4b5e4b8d7b43c7ad76
BLAKE2b-256 checksum
How to use checksums
d74240bbd8e9b77631e8c4105af907709da8fa3dcf4ab7bd77370cf824317193
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

Release files / exonum_precheck-0.1.5-py3-none-any.whl

Download URL exonum_precheck-0.1.5-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b99c2cc872c5fc334a5c5027c99bed43373edef8a82fee53142d81ed46dc19b
BLAKE2b-256 checksum
How to use checksums
19d9e7e6e04a00998611544bfb72fa54fafdb9114393538d627a585e2495e392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page