|
35 | 35 | done |
36 | 36 |
|
37 | 37 | e2e: |
38 | | - runs-on: ubuntu-latest |
39 | | - steps: |
40 | | - - uses: actions/checkout@v4 |
41 | | - |
42 | | - - uses: actions/setup-go@v5 |
43 | | - with: |
44 | | - go-version-file: go.mod |
45 | | - |
46 | | - - name: Run e2e tests |
47 | | - run: go test ./e2e/ -v -count=1 -timeout=120s |
48 | | - |
49 | | - integration: |
50 | | - runs-on: macos-latest |
51 | | - steps: |
52 | | - - uses: actions/checkout@v4 |
53 | | - |
54 | | - - uses: actions/setup-go@v5 |
55 | | - with: |
56 | | - go-version-file: go.mod |
57 | | - |
58 | | - - name: Install ios-webkit-debug-proxy |
59 | | - run: brew install ios-webkit-debug-proxy |
60 | | - |
61 | | - - name: Run all tests with integration tag and coverage |
62 | | - run: go test -tags=integration ./... -v -count=1 -timeout=120s -coverprofile=coverage-integration.out |
63 | | - |
64 | | - - name: Integration coverage summary |
65 | | - run: | |
66 | | - total=$(go tool cover -func=coverage-integration.out | tail -1 | awk '{print $NF}') |
67 | | - echo "## Integration Test Coverage (includes all tests)" >> "$GITHUB_STEP_SUMMARY" |
68 | | - echo "" >> "$GITHUB_STEP_SUMMARY" |
69 | | - echo "**Total: ${total}**" >> "$GITHUB_STEP_SUMMARY" |
70 | | - echo "" >> "$GITHUB_STEP_SUMMARY" |
71 | | - echo "| Package | Coverage |" >> "$GITHUB_STEP_SUMMARY" |
72 | | - echo "|---------|----------|" >> "$GITHUB_STEP_SUMMARY" |
73 | | - go tool cover -func=coverage-integration.out | grep -v "total:" | awk -F'\t+' '{print $1, $NF}' | sort -u -t' ' -k1,1 | while read -r pkg cov; do |
74 | | - echo "| \`${pkg}\` | ${cov} |" >> "$GITHUB_STEP_SUMMARY" |
75 | | - done |
76 | | -
|
77 | | - simulator: |
78 | 38 | runs-on: macos-latest |
79 | 39 | steps: |
80 | 40 | - uses: actions/checkout@v4 |
@@ -110,21 +70,21 @@ jobs: |
110 | 70 | eval "$(./scripts/sim-setup.sh)" |
111 | 71 | echo "IWDP_SIM_WS_URL=$IWDP_SIM_WS_URL" >> "$GITHUB_ENV" |
112 | 72 |
|
113 | | - - name: Run simulator tests with coverage |
114 | | - run: go test -tags=simulator ./... -v -count=1 -timeout=300s -coverprofile=coverage-simulator.out |
| 73 | + - name: Run e2e tests with coverage |
| 74 | + run: go test -tags=simulator ./e2e/ -v -count=1 -timeout=300s -coverprofile=coverage-e2e.out |
115 | 75 |
|
116 | | - - name: Simulator coverage summary |
| 76 | + - name: E2E coverage summary |
117 | 77 | if: always() |
118 | 78 | run: | |
119 | | - if [ -f coverage-simulator.out ]; then |
120 | | - total=$(go tool cover -func=coverage-simulator.out | tail -1 | awk '{print $NF}') |
121 | | - echo "## Simulator Test Coverage" >> "$GITHUB_STEP_SUMMARY" |
| 79 | + if [ -f coverage-e2e.out ]; then |
| 80 | + total=$(go tool cover -func=coverage-e2e.out | tail -1 | awk '{print $NF}') |
| 81 | + echo "## E2E Test Coverage" >> "$GITHUB_STEP_SUMMARY" |
122 | 82 | echo "" >> "$GITHUB_STEP_SUMMARY" |
123 | 83 | echo "**Total: ${total}**" >> "$GITHUB_STEP_SUMMARY" |
124 | 84 | echo "" >> "$GITHUB_STEP_SUMMARY" |
125 | 85 | echo "| Package | Coverage |" >> "$GITHUB_STEP_SUMMARY" |
126 | 86 | echo "|---------|----------|" >> "$GITHUB_STEP_SUMMARY" |
127 | | - go tool cover -func=coverage-simulator.out | grep -v "total:" | awk -F'\t+' '{print $1, $NF}' | sort -u -t' ' -k1,1 | while read -r pkg cov; do |
| 87 | + go tool cover -func=coverage-e2e.out | grep -v "total:" | awk -F'\t+' '{print $1, $NF}' | sort -u -t' ' -k1,1 | while read -r pkg cov; do |
128 | 88 | echo "| \`${pkg}\` | ${cov} |" >> "$GITHUB_STEP_SUMMARY" |
129 | 89 | done |
130 | 90 | fi |
|
0 commit comments