Skip to content

Commit

Permalink
ci: cherry-pick from Ci/next costs coverage (#2934)
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieC3 committed Nov 18, 2021
1 parent 8ceb0c0 commit e8d7e0a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/actions/bitcoin-int-tests/Dockerfile.bitcoin-tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV BITCOIND_TEST 1
RUN cargo build && \
cargo test -- --test-threads 1 --ignored "$test_name"

RUN grcov . --binary-path ../../target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info && \
RUN grcov . --binary-path ../../target/debug/ -s ../.. -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info && \
curl -Os https://uploader.codecov.io/latest/linux/codecov && \
chmod +x codecov && \
./codecov
./codecov --name "$test_name"
2 changes: 1 addition & 1 deletion .github/actions/bitcoin-int-tests/Dockerfile.code-cov
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ RUN cargo build && \
RUN grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info && \
curl -Os https://uploader.codecov.io/latest/linux/codecov && \
chmod +x codecov && \
./codecov
./codecov --name "unit_tests"
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ RUN rustup override set nightly && \
ENV RUSTFLAGS="-Zinstrument-coverage" \
LLVM_PROFILE_FILE="stacks-blockchain-%p-%m.profraw"

RUN cargo build
RUN cargo test --no-run && \
cargo build

RUN cd / && wget https://bitcoin.org/bin/bitcoin-core-0.20.0/bitcoin-0.20.0-x86_64-linux-gnu.tar.gz
RUN cd / && tar -xvzf bitcoin-0.20.0-x86_64-linux-gnu.tar.gz
Expand Down
17 changes: 15 additions & 2 deletions .github/actions/bitcoin-int-tests/Dockerfile.large-genesis
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@ WORKDIR /src

COPY . .

RUN cargo test --no-run --workspace

RUN cd / && wget https://bitcoin.org/bin/bitcoin-core-0.20.0/bitcoin-0.20.0-x86_64-linux-gnu.tar.gz
RUN cd / && tar -xvzf bitcoin-0.20.0-x86_64-linux-gnu.tar.gz

RUN ln -s /bitcoin-0.20.0/bin/bitcoind /bin/

RUN rustup override set nightly && \
rustup component add llvm-tools-preview && \
cargo install grcov

ENV RUSTFLAGS="-Zinstrument-coverage" \
LLVM_PROFILE_FILE="stacks-blockchain-%p-%m.profraw"

RUN cargo test --no-run --workspace && \
cargo build --workspace

ENV BITCOIND_TEST 1
RUN cd testnet/stacks-node && cargo test --release --features prod-genesis-chainstate -- --test-threads 1 --ignored neon_integrations::bitcoind_integration_test

RUN grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info && \
curl -Os https://uploader.codecov.io/latest/linux/codecov && \
chmod +x codecov && \
./codecov --name "large_genesis"
5 changes: 4 additions & 1 deletion .github/workflows/stacks-blockchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ jobs:
- name: Single full genesis integration test
env:
DOCKER_BUILDKIT: 1
run: docker build -f ./.github/actions/bitcoin-int-tests/Dockerfile.large-genesis .
# Remove .dockerignore file so codecov has access to git info
run: |
rm .dockerignore
docker build -f ./.github/actions/bitcoin-int-tests/Dockerfile.large-genesis .
# Run unit tests with code coverage
unit-tests:
Expand Down

0 comments on commit e8d7e0a

Please sign in to comment.