Repository navigation
test(integration): cover cold-start module tracing #163
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: local integration tests | |
| # Runs the docker-only integration test harness in integration_tests_local/ | |
| # against the real AWS Lambda base images + the Runtime Interface Emulator | |
| # (RIE). No AWS account or credentials required. | |
| # | |
| # One job per Node major version and CPU architecture; each job builds the | |
| # container/layer fixture images and runs every case against that runtime. | |
| # The fixtures share the same ~1 GB base image, so each job pulls it exactly | |
| # once. If public.ecr.aws anonymous pull limits ever bite, the fix is to | |
| # mirror the base images to GHCR (same pattern dd-trace-js uses in its | |
| # mirror-image.yml workflow). | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - "main" | |
| workflow_dispatch: | |
| jobs: | |
| container: | |
| name: nodejs${{ matrix.node_major }}.x (${{ matrix.architecture }}) | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node_major: ["18", "20", "22", "24", "26"] | |
| architecture: ["amd64", "arm64"] | |
| include: | |
| - architecture: "amd64" | |
| platform: "linux/amd64" | |
| runner: "ubuntu-latest" | |
| - architecture: "arm64" | |
| platform: "linux/arm64" | |
| runner: "ubuntu-24.04-arm" | |
| # Host Node must match the Lambda runtime so yarn installs the | |
| # matching dd-trace line (v5 on 18/20, v6 on 22+) with working | |
| # native prebuilds. Packing v6 on Node 18 (--ignore-engines) is | |
| # what local Node 22+ never hits. | |
| - node_major: "18" | |
| node_version: "18.12" | |
| - node_major: "20" | |
| node_version: "20.19" | |
| - node_major: "22" | |
| node_version: "22.11" | |
| - node_major: "24" | |
| node_version: "24.11" | |
| - node_major: "26" | |
| node_version: "26.1" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
| - name: Set up Node ${{ matrix.node_version }} | |
| uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1 | |
| with: | |
| node-version: ${{ matrix.node_version }} | |
| - name: Test structural trace assertions | |
| run: node --test integration_tests_local/check-*.test.js | |
| - name: Run local container integration tests (nodejs${{ matrix.node_major }}.x, ${{ matrix.architecture }}) | |
| run: PLATFORM=${{ matrix.platform }} RUNTIME_PARAM=${{ matrix.node_major }} ./integration_tests_local/run.sh | |
| # Every leg is a strict comparison, so a run must leave the snapshots | |
| # untouched. Writing here would mean the harness recorded its own output | |
| # as the expectation instead of checking against it. | |
| - name: Assert no snapshot was written | |
| if: always() | |
| run: | | |
| if ! git diff --exit-code --stat integration_tests_local/snapshots; then | |
| echo "FAILURE: this run modified committed snapshots" >&2 | |
| exit 1 | |
| fi | |
| new_files=$(git ls-files --others --exclude-standard integration_tests_local/snapshots) | |
| if [ -n "$new_files" ]; then | |
| echo "FAILURE: strict leg created snapshots instead of comparing:" >&2 | |
| echo "$new_files" >&2 | |
| exit 1 | |
| fi |