FROM stacks-node:integrations AS test

ARG test_name
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

FROM scratch AS export-stage
COPY --from=test /lcov.info /
