mirror of
https://github.com/alexgo-io/stacks-subnets.git
synced 2026-01-12 22:43:44 +08:00
a handful of test fixes, warning cleanup, and added Dockerfile for execing tests with stacks-node
This commit is contained in:
@@ -12,7 +12,7 @@ ENV RUSTFLAGS="-Zinstrument-coverage" \
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --workspace && \
|
||||
cargo test --workspace --bin=stacks-node -- --ignored --test-threads 1
|
||||
cargo test --workspace --bin=hyperchain-node -- --ignored --test-threads 1
|
||||
|
||||
# Generate coverage report and upload it to codecov
|
||||
RUN grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
|
||||
|
||||
26
.github/actions/bitcoin-int-tests/Dockerfile.stacks-node
vendored
Normal file
26
.github/actions/bitcoin-int-tests/Dockerfile.stacks-node
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM blockstack/stacks-blockchain:2.05.0.1.0-stretch as stacks-node
|
||||
|
||||
FROM rust:stretch AS test
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
RUN rustup override set nightly-2022-01-14 && \
|
||||
rustup component add llvm-tools-preview && \
|
||||
cargo install grcov
|
||||
|
||||
ENV RUSTFLAGS="-Zinstrument-coverage" \
|
||||
LLVM_PROFILE_FILE="stacks-blockchain-%p-%m.profraw" \
|
||||
STACKS_NODE_TEST="1"
|
||||
|
||||
COPY --from=stacks-node /bin/stacks-node /bin/
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --workspace && \
|
||||
cargo test --workspace --bin=hyperchain-node -- l1_observer_test --test-threads 1
|
||||
|
||||
# Generate coverage report and upload it to codecov
|
||||
RUN grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
|
||||
|
||||
FROM scratch AS export-stage
|
||||
COPY --from=test /build/lcov.info /
|
||||
18
.github/workflows/stacks-blockchain.yml
vendored
18
.github/workflows/stacks-blockchain.yml
vendored
@@ -53,7 +53,23 @@ jobs:
|
||||
files: ./coverage-output/lcov.info
|
||||
name: unit_tests
|
||||
fail_ci_if_error: true
|
||||
|
||||
# Run tests that require stacks-node
|
||||
layer-1-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run units tests (with coverage)
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
# Remove .dockerignore file so codecov has access to git info
|
||||
run: |
|
||||
rm .dockerignore
|
||||
docker build -o coverage-output -f ./.github/actions/bitcoin-int-tests/Dockerfile.stacks-node .
|
||||
- uses: codecov/codecov-action@v2
|
||||
with:
|
||||
files: ./coverage-output/lcov.info
|
||||
name: integration_tests
|
||||
fail_ci_if_error: true
|
||||
# Run integration tests
|
||||
integration-tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user