Skip to content

Commit

Permalink
Run token-bridge tests in CI
Browse files Browse the repository at this point in the history
Update the dockerfile, tiltfile, and makefile so that the token-bridge
tests are included when running in CI.
  • Loading branch information
jynnantonix committed May 9, 2022
1 parent ff40fa3 commit 66f031c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 13 additions & 0 deletions solana/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 /

2 changes: 1 addition & 1 deletion solana/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66f031c

Please sign in to comment.