forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (77 loc) · 2.84 KB
/
debug-layer-tests.yml
File metadata and controls
96 lines (77 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Debug Layer Order Tests
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
SAM_CLI_DEV: 1
SAM_CLI_TELEMETRY: 0
SAM_CLI_CONTAINER_CONNECTION_TIMEOUT: 60
NOSE_PARAMETERIZED_NO_WARN: 1
UV_PYTHON: python3.11
jobs:
debug-layer-tests:
name: Debug Layer Order (docker)
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Free up disk space
run: |
nohup sudo rm -rf /usr/share/dotnet /usr/local/share/powershell /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL &
nohup docker system prune -af --volumes || true &
- name: Configure AWS credentials via OIDC
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ secrets.OIDC_ROLE_ARN }}
aws-region: us-west-2
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: |
3.11
3.9
- name: Setup Docker runtime
run: |
docker info
docker version
- name: Setup QEMU for ARM64 emulation
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Initialize project
run: make init
- name: Login to Public ECR
run: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
- name: Add debug instrumentation
run: python3.11 .github/scripts/instrument_layer_debug.py
- name: Verify instrumentation
run: grep -c "DEBUG_LAYER_ORDER" samcli/local/layers/layer_downloader.py samcli/local/docker/lambda_image.py samcli/lib/utils/tar.py
- name: Run TestLayerVersion tests with debug logging
run: |
pytest -vv --reruns 3 \
tests/integration/local/invoke/test_integrations_cli.py \
-k "TestLayerVersion" \
--log-cli-level=DEBUG \
--json-report \
--json-report-file=TEST_REPORT-integration-local-invoke-docker.json \
2>&1 | tee full_test_output.log
- name: Extract debug layer order lines
if: always()
run: |
echo "=== DEBUG_LAYER_ORDER lines ==="
grep "DEBUG_LAYER_ORDER" full_test_output.log || echo "No DEBUG_LAYER_ORDER lines found"
echo ""
echo "=== Test results summary ==="
grep -E "PASSED|FAILED|ERROR" full_test_output.log | grep -i "layer" || true
echo ""
echo "=== Docker images after tests ==="
docker images | head -30 || true
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v6
with:
name: debug-layer-logs
path: |
full_test_output.log
TEST_REPORT-integration-local-invoke-docker.json