declapract-typescript-ehmpathy 0.47.18 → 0.47.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@ jobs:
25
25
  # run tests in parallel
26
26
  test-commits:
27
27
  runs-on: ubuntu-24.04
28
- needs: [install]
28
+ needs: [install, test-shards-omit]
29
29
  steps:
30
30
  - name: checkout
31
31
  uses: actions/checkout@v4
@@ -48,7 +48,7 @@ jobs:
48
48
 
49
49
  test-types:
50
50
  runs-on: ubuntu-24.04
51
- needs: [install]
51
+ needs: [install, test-shards-omit]
52
52
  steps:
53
53
  - name: checkout
54
54
  uses: actions/checkout@v4
@@ -69,7 +69,7 @@ jobs:
69
69
 
70
70
  test-format:
71
71
  runs-on: ubuntu-24.04
72
- needs: [install]
72
+ needs: [install, test-shards-omit]
73
73
  steps:
74
74
  - name: checkout
75
75
  uses: actions/checkout@v4
@@ -93,7 +93,7 @@ jobs:
93
93
 
94
94
  test-lint:
95
95
  runs-on: ubuntu-24.04
96
- needs: [install]
96
+ needs: [install, test-shards-omit]
97
97
  steps:
98
98
  - name: checkout
99
99
  uses: actions/checkout@v4
@@ -114,7 +114,7 @@ jobs:
114
114
 
115
115
  test-unit:
116
116
  runs-on: ubuntu-24.04
117
- needs: [install]
117
+ needs: [install, test-shards-omit]
118
118
  steps:
119
119
  - name: checkout
120
120
  uses: actions/checkout@v4
@@ -133,9 +133,56 @@ jobs:
133
133
  - name: test:unit
134
134
  run: THOROUGH=true npm run test:unit
135
135
 
136
- test-integration:
136
+ # shard setup job
137
+ enshard:
138
+ name: enshard
139
+ runs-on: ubuntu-24.04
140
+ outputs:
141
+ integration-matrix: ${{ steps.integration.outputs.matrix }}
142
+ integration-patterns: ${{ steps.integration.outputs.patterns }}
143
+ acceptance-matrix: ${{ steps.acceptance.outputs.matrix }}
144
+ acceptance-patterns: ${{ steps.acceptance.outputs.patterns }}
145
+ steps:
146
+ - name: checkout
147
+ uses: actions/checkout@v4
148
+ with:
149
+ sparse-checkout: |
150
+ jest.integration.shards.jsonc
151
+ jest.acceptance.shards.jsonc
152
+ .github/actions/test-shards-setup
153
+ sparse-checkout-cone-mode: false
154
+
155
+ - name: setup integration shards
156
+ id: integration
157
+ uses: ./.github/actions/test-shards-setup
158
+ with:
159
+ config-file: jest.integration.shards.jsonc
160
+ test-type: integration
161
+
162
+ - name: setup acceptance shards
163
+ id: acceptance
164
+ uses: ./.github/actions/test-shards-setup
165
+ with:
166
+ config-file: jest.acceptance.shards.jsonc
167
+ test-type: acceptance
168
+
169
+ # placeholder job for github actions visualization alignment
170
+ # note: github actions has no column position controls;
171
+ # this job pushes test-* jobs one column right to align with test-shards-* column
172
+ test-shards-omit:
137
173
  runs-on: ubuntu-24.04
138
174
  needs: [install]
175
+ steps:
176
+ - run: echo "👌 placeholder for column alignment"
177
+
178
+ # shard runner jobs
179
+ test-shards-integration:
180
+ runs-on: ubuntu-24.04
181
+ needs: [install, enshard]
182
+ strategy:
183
+ fail-fast: false
184
+ matrix:
185
+ shard: ${{ fromJson(needs.enshard.outputs.integration-matrix) }}
139
186
  steps:
140
187
  - name: checkout
141
188
  uses: actions/checkout@v4
@@ -164,12 +211,44 @@ jobs:
164
211
  - name: start:livedb:dev
165
212
  run: npm run start:livedb:dev --if-present
166
213
 
167
- - name: test:integration
168
- run: THOROUGH=true npm run test:integration
169
-
170
- test-acceptance-locally:
214
+ - name: build
215
+ run: npm run build
216
+
217
+ - name: test:integration (explicit ${{ matrix.shard.index }})
218
+ if: matrix.shard.type == 'explicit'
219
+ run: |
220
+ patterns='${{ join(matrix.shard.patterns, '|') }}'
221
+ THOROUGH=true npm run test:integration -- --testPathPattern="$patterns" --json --outputFile=jest-results.json
222
+
223
+ - name: test:integration (dynamic ${{ matrix.shard.shard }}/${{ matrix.shard.total }})
224
+ if: matrix.shard.type == 'dynamic'
225
+ run: |
226
+ exclude='${{ needs.enshard.outputs.integration-patterns }}'
227
+ if [[ -n "$exclude" ]]; then
228
+ THOROUGH=true npm run test:integration -- --testPathIgnorePatterns="$exclude" --shard=${{ matrix.shard.shard }}/${{ matrix.shard.total }} --json --outputFile=jest-results.json
229
+ else
230
+ THOROUGH=true npm run test:integration -- --shard=${{ matrix.shard.shard }}/${{ matrix.shard.total }} --json --outputFile=jest-results.json
231
+ fi
232
+
233
+ - name: report slow tests
234
+ if: always() && hashFiles('jest-results.json') != ''
235
+ run: |
236
+ jq -r '.testResults[] | "\(.name):\(.perfStats.runtime)"' jest-results.json | while IFS=: read -r name runtime; do
237
+ seconds=$((runtime / 1000))
238
+ if [[ $seconds -ge 30 ]]; then
239
+ echo "::warning file=${name}::slow test: ${seconds}s"
240
+ elif [[ $seconds -ge 10 ]]; then
241
+ echo "::notice file=${name}::test duration: ${seconds}s"
242
+ fi
243
+ done
244
+
245
+ test-shards-acceptance:
171
246
  runs-on: ubuntu-24.04
172
- needs: [install]
247
+ needs: [install, enshard]
248
+ strategy:
249
+ fail-fast: false
250
+ matrix:
251
+ shard: ${{ fromJson(needs.enshard.outputs.acceptance-matrix) }}
173
252
  steps:
174
253
  - name: checkout
175
254
  uses: actions/checkout@v4
@@ -198,5 +277,63 @@ jobs:
198
277
  - name: start:livedb:dev
199
278
  run: npm run start:livedb:dev --if-present
200
279
 
201
- - name: test:acceptance:locally
202
- run: THOROUGH=true npm run test:acceptance:locally --if-present
280
+ - name: build
281
+ run: npm run build
282
+
283
+ - name: test:acceptance (explicit ${{ matrix.shard.index }})
284
+ if: matrix.shard.type == 'explicit'
285
+ run: |
286
+ patterns='${{ join(matrix.shard.patterns, '|') }}'
287
+ THOROUGH=true npm run test:acceptance -- --testPathPattern="$patterns" --json --outputFile=jest-results.json
288
+
289
+ - name: test:acceptance (dynamic ${{ matrix.shard.shard }}/${{ matrix.shard.total }})
290
+ if: matrix.shard.type == 'dynamic'
291
+ run: |
292
+ exclude='${{ needs.enshard.outputs.acceptance-patterns }}'
293
+ if [[ -n "$exclude" ]]; then
294
+ THOROUGH=true npm run test:acceptance -- --testPathIgnorePatterns="$exclude" --shard=${{ matrix.shard.shard }}/${{ matrix.shard.total }} --json --outputFile=jest-results.json
295
+ else
296
+ THOROUGH=true npm run test:acceptance -- --shard=${{ matrix.shard.shard }}/${{ matrix.shard.total }} --json --outputFile=jest-results.json
297
+ fi
298
+
299
+ - name: report slow tests
300
+ if: always() && hashFiles('jest-results.json') != ''
301
+ run: |
302
+ jq -r '.testResults[] | "\(.name):\(.perfStats.runtime)"' jest-results.json | while IFS=: read -r name runtime; do
303
+ seconds=$((runtime / 1000))
304
+ if [[ $seconds -ge 30 ]]; then
305
+ echo "::warning file=${name}::slow test: ${seconds}s"
306
+ elif [[ $seconds -ge 10 ]]; then
307
+ echo "::notice file=${name}::test duration: ${seconds}s"
308
+ fi
309
+ done
310
+
311
+ # union job: aggregates shard results into single status for pr merge constraints
312
+ test-integration:
313
+ runs-on: ubuntu-24.04
314
+ needs: [install, enshard, test-shards-integration]
315
+ if: always() && needs.install.result == 'success' && needs.enshard.result == 'success'
316
+ steps:
317
+ - name: report shard results
318
+ run: |
319
+ if [[ "${{ needs.test-shards-integration.result }}" == "success" ]]; then
320
+ echo "👌 all integration test shards passed"
321
+ else
322
+ echo "::error::some integration test shards failed"
323
+ exit 1
324
+ fi
325
+
326
+ # union job: aggregates shard results into single status for pr merge constraints
327
+ test-acceptance-locally:
328
+ runs-on: ubuntu-24.04
329
+ needs: [install, enshard, test-shards-acceptance]
330
+ if: always() && needs.install.result == 'success' && needs.enshard.result == 'success'
331
+ steps:
332
+ - name: report shard results
333
+ run: |
334
+ if [[ "${{ needs.test-shards-acceptance.result }}" == "success" ]]; then
335
+ echo "👌 all acceptance test shards passed"
336
+ else
337
+ echo "::error::some acceptance test shards failed"
338
+ exit 1
339
+ fi
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "declapract-typescript-ehmpathy",
3
3
  "author": "ehmpathy",
4
4
  "description": "declapract best practices declarations for typescript",
5
- "version": "0.47.18",
5
+ "version": "0.47.19",
6
6
  "license": "MIT",
7
7
  "main": "src/index.js",
8
8
  "repository": "ehmpathy/declapract-typescript-ehmpathy",