Run token-bridge tests in CI

Update the dockerfile, tiltfile, and makefile so that the token-bridge
tests are included when running in CI.
This commit is contained in:
Chirantan Ekbote 2022-04-19 15:44:42 +09:00 committed by Chirantan Ekbote
parent ff40fa34b8
commit 66f031c51b
3 changed files with 15 additions and 2 deletions

View File

@ -414,7 +414,7 @@ if ci_tests:
name = "solana-tests",
deps = ["solana"],
dir = "solana",
cmd = "tilt docker build -- -f Dockerfile --target ci_tests .",
cmd = "tilt docker build -- -f Dockerfile --target ci_tests --build-arg BRIDGE_ADDRESS=Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o .",
env = {"DOCKER_BUILDKIT": "1"},
labels = ["ci"],
allow_parallel = True,

View File

@ -70,11 +70,24 @@ FROM solana AS ci_tests
# This emitter address is necessary for the governance tests.
ENV EMITTER_ADDRESS="CiByUvEcx7w2HA4VHcPCBUAFQ73Won9kB36zW9VjirSr"
ARG BRIDGE_ADDRESS
RUN [ -n "${BRIDGE_ADDRESS}" ]
# This is a pre-built contract.
RUN --mount=type=cache,target=target,id=test \
mkdir -p target/deploy && \
cp modules/token_bridge/token-metadata/spl_token_metadata.so target/deploy/
RUN --mount=type=cache,target=target,id=test \
cargo test-bpf \
--manifest-path bridge/program/Cargo.toml \
--features trace,instructions
RUN --mount=type=cache,target=target,id=test \
cargo test-bpf \
--manifest-path modules/token_bridge/program/Cargo.toml \
--features trace,instructions
FROM scratch AS export-stage
COPY --from=builder /opt/solana/deps /

View File

@ -73,7 +73,7 @@ deploy/nft_bridge: nft_bridge-buffer-$(NETWORK).txt
test:
@echo "Running integration tests"
DOCKER_BUILDKIT=1 docker build -f Dockerfile --target ci_tests .
DOCKER_BUILDKIT=1 docker build -f Dockerfile --target ci_tests --build-arg BRIDGE_ADDRESS=${bridge_ADDRESS_devnet} .
clean:
rm -rf artifacts-mainnet artifacts-testnet artifacts-devnet *-buffer-*.txt