FROM subnet-node:integrations AS test

ARG test_name
ENV STACKS_NODE_TEST="1"

RUN cargo test --workspace --bin=subnet-node -- --test-threads 1 "$test_name"

# 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 /
