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: use nextest for unit tests, disable grcov collation and codecov o… #3811

Merged
merged 12 commits into from
Jul 27, 2023
30 changes: 23 additions & 7 deletions .github/workflows/bitcoin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ jobs:
- name: Checkout the latest code
id: git_checkout
uses: actions/checkout@v3

- name: Reclaim disk space
id: cleanup
run: |
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^mongodb-.*'
sudo apt-get remove -y '^mysql-.*'
sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
sudo apt-get autoremove -y
sudo apt-get clean
docker system prune --force

- name: Build bitcoin integration testing image
id: build_docker_image
env:
Expand All @@ -35,15 +49,17 @@ jobs:
run: |
rm .dockerignore
docker build -f ./.github/actions/bitcoin-int-tests/Dockerfile.generic.bitcoin-tests -t stacks-blockchain:integrations .

- name: Export docker image as tarball
id: export_docker_image
run: docker save -o integration-image.tar stacks-blockchain:integrations
run: docker save stacks-blockchain:integrations | gzip > integration-image.tar.gz

- name: Upload built docker image
id: upload_docker_image
uses: actions/upload-artifact@v3
with:
name: integration-image.tar
path: integration-image.tar
name: integration-image.tar.gz
path: integration-image.tar.gz

# Run integration tests using sampled genesis block
sampled-genesis:
Expand Down Expand Up @@ -130,10 +146,10 @@ jobs:
id: download_docker_image
uses: actions/download-artifact@v3
with:
name: integration-image.tar
name: integration-image.tar.gz
- name: Load docker image
id: load_docker_image
run: docker load -i integration-image.tar && rm integration-image.tar
run: docker load -i integration-image.tar.gz && rm integration-image.tar.gz
- name: All integration tests with sampled genesis
id: bitcoin_integration_tests
timeout-minutes: 30
Expand Down Expand Up @@ -169,10 +185,10 @@ jobs:
id: download_docker_image
uses: actions/download-artifact@v3
with:
name: integration-image.tar
name: integration-image.tar.gz
- name: Load docker image
id: load_docker_image
run: docker load -i integration-image.tar && rm integration-image.tar
run: docker load -i integration-image.tar.gz && rm integration-image.tar.gz
- name: Atlas integration tests
id: atlas_integration_tests
timeout-minutes: 40
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/stacks-blockchain-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
run: |
rustup component add llvm-tools-preview
cargo install grcov
- name: Add nextest
run: |
cargo install cargo-nextest
- name: Checkout the latest code
id: git_checkout
uses: actions/checkout@v3
Expand All @@ -53,9 +56,23 @@ jobs:
RUSTFLAGS: -Cinstrument-coverage
LLVM_PROFILE_FILE: stacks-blockchain-%p-%m.profraw
run: |
cargo test --workspace
cargo nextest run --workspace
- name: Collate grcov
# grcov doesn't work with cargo nextest currently, getting
# that to work again will have to happen separately. Getting unit
# test run times below 2 hours is more important for now.
if: ${{ false }}
id: unit_tests_grcov
env:
RUSTFLAGS: -Cinstrument-coverage
LLVM_PROFILE_FILE: stacks-blockchain-%p-%m.profraw
run: |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
- name: Upload codecov results
# grcov doesn't work with cargo nextest currently, getting
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting. i'll have to double check my fork - i was under the impression this was working in that fork's workflows. lack of an error != it's working though, so i'll verify that.

# that to work again will have to happen separately. Getting unit
# test run times below 2 hours is more important for now.
if: ${{ false }}
uses: codecov/codecov-action@v3
id: codedov
with:
Expand Down