Skip to content

Commit 72290d0

Browse files
committed
feat: run integration tests inside Docker container
- Execute integration tests via docker exec to access cargo-lambda - Add testdata volume mount for test file access - Enable COMPOSE_BAKE for potential build performance improvements - Set CARGO_TERM_COLOR=never for cleaner CI logs - Replace host-based cargo lambda invoke with container-based execution Fixes "no such command: lambda" errors in CI by running tests where cargo-lambda is installed rather than on the bare GitHub Actions runner.
1 parent d6a3fca commit 72290d0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ on:
77
branches: [ main ]
88

99
env:
10-
CARGO_TERM_COLOR: always
10+
CARGO_TERM_COLOR: never
1111

1212
jobs:
1313
test:
1414
name: Test
1515
runs-on: ubuntu-latest
1616

17+
env:
18+
COMPOSE_BAKE: true
19+
1720
steps:
1821
- name: Checkout code
1922
uses: actions/checkout@v4
@@ -55,4 +58,5 @@ jobs:
5558
done
5659
5760
- name: Run integration tests
58-
run: cargo test --test integration_tests --release
61+
run: docker exec aws-lambda-action-filter-lambda-1 \
62+
cargo test --test integration_tests --release --quiet

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ services:
88
ports:
99
- "9000:9000"
1010
volumes:
11-
- ./src:/app/src # hot-reload watch point
11+
- ./src:/app/src # hot-reload watch point for lambda server
12+
- ./testdata:/app/testdata # testdata for lambda invoke
1213
- ./Cargo.toml:/app/Cargo.toml
1314
- ./Cargo.lock:/app/Cargo.lock
1415
- ${CR8S_SCRATCH_DIR:-/var/tmp}/aws/dev-cargo:/usr/local/cargo/registry

0 commit comments

Comments
 (0)