Skip to content

Commit f90b663

Browse files
authored
EXUI-4306 add Playwright tag filters and Jenkins worker controls (#5007)
* test: add Playwright tag filters and Jenkins worker controls * test: add Playwright tag filters and Jenkins worker controls * test: fix Playwright new-test tag filters and Jenkins params
1 parent 88baf16 commit f90b663

33 files changed

Lines changed: 885 additions & 470 deletions

Jenkinsfile_CNP

Lines changed: 116 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,32 @@ properties([
1313
string(
1414
name: 'API_PW_INCLUDE_TAGS',
1515
defaultValue: '',
16-
description: 'Optional comma/space separated Playwright service tags to include for API tests, for example @svc-ccd,@svc-work-allocation'
16+
description: 'Optional comma/space separated Playwright API tags to include, for example @svc-ccd,@svc-work-allocation or @svc-auth @svc-cors'
1717
),
1818
string(
1919
name: 'API_PW_EXCLUDED_TAGS_OVERRIDE',
2020
defaultValue: '',
21-
description: 'Optional comma/space separated Playwright service tags to exclude; when set this overrides playwright_tests_new/api/service-tag-filter.json'
21+
description: 'Optional comma/space separated Playwright API tags to exclude; overrides playwright_tests_new/api/service-tag-filter.json. Examples: @svc-work-allocation, @svc-auth @svc-cors, @none to clear repo defaults'
22+
),
23+
string(
24+
name: 'E2E_PW_INCLUDE_TAGS',
25+
defaultValue: '',
26+
description: 'Optional comma/space separated Playwright E2E tags to include, for example @e2e-search-case or @e2e-search-case @e2e-update-case'
27+
),
28+
string(
29+
name: 'E2E_PW_EXCLUDED_TAGS_OVERRIDE',
30+
defaultValue: '',
31+
description: 'Optional comma/space separated Playwright E2E tags to exclude; overrides playwright_tests_new/E2E/tag-filter.json. Examples: @e2e-manage-tasks, @e2e-document-upload @e2e-case-flags, @none to clear repo defaults'
32+
),
33+
string(
34+
name: 'INTEGRATION_PW_INCLUDE_TAGS',
35+
defaultValue: '',
36+
description: 'Optional comma/space separated Playwright integration tags to include, for example @integration-search-case or @integration-search-case @integration-create-case'
37+
),
38+
string(
39+
name: 'INTEGRATION_PW_EXCLUDED_TAGS_OVERRIDE',
40+
defaultValue: '',
41+
description: 'Optional comma/space separated Playwright integration tags to exclude; overrides playwright_tests_new/integration/tag-filter.json. Examples: @integration-manage-tasks, @integration-case-list @integration-welsh-language, @none to clear repo defaults'
2242
)
2343
])
2444
])
@@ -235,7 +255,7 @@ withPipeline(type, product, component) {
235255
api: {
236256
stage('API Tests') {
237257
withEnv([
238-
"FUNCTIONAL_TESTS_WORKERS=8",
258+
"FUNCTIONAL_TESTS_WORKERS=2",
239259
"API_PW_INCLUDE_TAGS=${params.API_PW_INCLUDE_TAGS ?: ''}",
240260
"API_PW_EXCLUDED_TAGS_OVERRIDE=${params.API_PW_EXCLUDED_TAGS_OVERRIDE ?: ''}"
241261
]) {
@@ -282,43 +302,57 @@ withPipeline(type, product, component) {
282302
},
283303
playwrightIntegration: {
284304
stage('Playwright Integration Tests') {
285-
try {
286-
yarnBuilder.yarn('test:playwright:integration')
287-
} catch (Exception e) {
288-
echo "[failFast] Playwright Integration Tests catch: ${e.getClass().getName()}: ${e.getMessage()}"
289-
if (handleFailFastAbort(e)) { return }
290-
throw e
291-
} finally {
292-
publishHTML([
293-
allowMissing : true,
294-
alwaysLinkToLastBuild: true,
295-
keepAll : true,
296-
reportDir : 'functional-output/tests/playwright-integration/odhin-report/',
297-
reportFiles : 'xui-playwright-integration.html',
298-
reportName : 'PREVIEW Playwright Integration Test'
299-
])
300-
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/tests/playwright-integration/**/*'
305+
withEnv([
306+
"FUNCTIONAL_TESTS_WORKERS=2",
307+
"PLAYWRIGHT_SKIP_INSTALL=true",
308+
"INTEGRATION_PW_INCLUDE_TAGS=${params.INTEGRATION_PW_INCLUDE_TAGS ?: ''}",
309+
"INTEGRATION_PW_EXCLUDED_TAGS_OVERRIDE=${params.INTEGRATION_PW_EXCLUDED_TAGS_OVERRIDE ?: ''}"
310+
]) {
311+
try {
312+
yarnBuilder.yarn('test:playwright:integration')
313+
} catch (Exception e) {
314+
echo "[failFast] Playwright Integration Tests catch: ${e.getClass().getName()}: ${e.getMessage()}"
315+
if (handleFailFastAbort(e)) { return }
316+
throw e
317+
} finally {
318+
publishHTML([
319+
allowMissing : true,
320+
alwaysLinkToLastBuild: true,
321+
keepAll : true,
322+
reportDir : 'functional-output/tests/playwright-integration/odhin-report/',
323+
reportFiles : 'xui-playwright-integration.html',
324+
reportName : 'PREVIEW Playwright Integration Test'
325+
])
326+
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/tests/playwright-integration/**/*'
327+
}
301328
}
302329
}
303330
},
304331
playwrightE2E: {
305332
stage('Playwright E2E') {
306-
try {
307-
yarnBuilder.yarn('test:playwrightE2E')
308-
} catch (Exception e) {
309-
echo "[failFast] Playwright E2E catch: ${e.getClass().getName()}: ${e.getMessage()}"
310-
if (handleFailFastAbort(e)) { return }
311-
throw e
312-
} finally {
313-
publishHTML([
314-
allowMissing : true,
315-
alwaysLinkToLastBuild: true,
316-
keepAll : true,
317-
reportDir : "functional-output/tests/playwright-e2e/odhin-report/",
318-
reportFiles : 'xui-playwright-e2e.html',
319-
reportName : 'PREVIEW Playwright E2E'
320-
])
321-
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/tests/playwright-e2e/odhin-report/*'
333+
withEnv([
334+
"FUNCTIONAL_TESTS_WORKERS=2",
335+
"PLAYWRIGHT_SKIP_INSTALL=true",
336+
"E2E_PW_INCLUDE_TAGS=${params.E2E_PW_INCLUDE_TAGS ?: ''}",
337+
"E2E_PW_EXCLUDED_TAGS_OVERRIDE=${params.E2E_PW_EXCLUDED_TAGS_OVERRIDE ?: ''}"
338+
]) {
339+
try {
340+
yarnBuilder.yarn('test:playwrightE2E')
341+
} catch (Exception e) {
342+
echo "[failFast] Playwright E2E catch: ${e.getClass().getName()}: ${e.getMessage()}"
343+
if (handleFailFastAbort(e)) { return }
344+
throw e
345+
} finally {
346+
publishHTML([
347+
allowMissing : true,
348+
alwaysLinkToLastBuild: true,
349+
keepAll : true,
350+
reportDir : "functional-output/tests/playwright-e2e/odhin-report/",
351+
reportFiles : 'xui-playwright-e2e.html',
352+
reportName : 'PREVIEW Playwright E2E'
353+
])
354+
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/tests/playwright-e2e/odhin-report/*'
355+
}
322356
}
323357
}
324358
}
@@ -349,6 +383,7 @@ withPipeline(type, product, component) {
349383
api: {
350384
stage('API Tests') {
351385
withEnv([
386+
"FUNCTIONAL_TESTS_WORKERS=4",
352387
"API_PW_INCLUDE_TAGS=${params.API_PW_INCLUDE_TAGS ?: ''}",
353388
"API_PW_EXCLUDED_TAGS_OVERRIDE=${params.API_PW_EXCLUDED_TAGS_OVERRIDE ?: ''}"
354389
]) {
@@ -395,42 +430,57 @@ withPipeline(type, product, component) {
395430
},
396431
playwrightIntegration: {
397432
stage('Playwright Integration Tests') {
398-
try {
399-
yarnBuilder.yarn('test:playwright:integration')
400-
} catch (Exception e) {
401-
echo "[failFast] Playwright Integration Tests catch: ${e.getClass().getName()}: ${e.getMessage()}"
402-
if (handleFailFastAbort(e)) { return }
403-
throw e
404-
} finally {
405-
publishHTML([
406-
allowMissing : true,
407-
alwaysLinkToLastBuild: true,
408-
keepAll : true,
409-
reportDir : 'functional-output/tests/playwright-integration/odhin-report/',
410-
reportFiles : 'xui-playwright-integration.html',
411-
reportName : 'AAT Playwright Integration Test'
412-
])
413-
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/tests/playwright-integration/**/*'
433+
withEnv([
434+
"FUNCTIONAL_TESTS_WORKERS=4",
435+
"PLAYWRIGHT_SKIP_INSTALL=true",
436+
"INTEGRATION_PW_INCLUDE_TAGS=${params.INTEGRATION_PW_INCLUDE_TAGS ?: ''}",
437+
"INTEGRATION_PW_EXCLUDED_TAGS_OVERRIDE=${params.INTEGRATION_PW_EXCLUDED_TAGS_OVERRIDE ?: ''}"
438+
]) {
439+
try {
440+
yarnBuilder.yarn('test:playwright:integration')
441+
} catch (Exception e) {
442+
echo "[failFast] Playwright Integration Tests catch: ${e.getClass().getName()}: ${e.getMessage()}"
443+
if (handleFailFastAbort(e)) { return }
444+
throw e
445+
} finally {
446+
publishHTML([
447+
allowMissing : true,
448+
alwaysLinkToLastBuild: true,
449+
keepAll : true,
450+
reportDir : 'functional-output/tests/playwright-integration/odhin-report/',
451+
reportFiles : 'xui-playwright-integration.html',
452+
reportName : 'AAT Playwright Integration Test'
453+
])
454+
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/tests/playwright-integration/**/*'
455+
}
414456
}
415457
}
416458
},
417459
playwrightE2E: {
418460
stage('Playwright E2E') {
419-
try {
420-
yarnBuilder.yarn('test:playwrightE2E')
421-
} catch (Exception e) {
422-
echo "[failFast] Playwright E2E catch: ${e.getClass().getName()}: ${e.getMessage()}"
423-
if (handleFailFastAbort(e)) { return }
424-
throw e
425-
} finally {
426-
publishHTML([
427-
allowMissing : true,
428-
alwaysLinkToLastBuild: true,
429-
keepAll : true,
430-
reportDir : "functional-output/tests/playwright-e2e/odhin-report/",
431-
reportFiles : 'xui-playwright-e2e.html',
432-
reportName : 'AAT Playwright E2E'
433-
])
461+
withEnv([
462+
"FUNCTIONAL_TESTS_WORKERS=4",
463+
"PLAYWRIGHT_SKIP_INSTALL=true",
464+
"E2E_PW_INCLUDE_TAGS=${params.E2E_PW_INCLUDE_TAGS ?: ''}",
465+
"E2E_PW_EXCLUDED_TAGS_OVERRIDE=${params.E2E_PW_EXCLUDED_TAGS_OVERRIDE ?: ''}"
466+
]) {
467+
try {
468+
yarnBuilder.yarn('test:playwrightE2E')
469+
} catch (Exception e) {
470+
echo "[failFast] Playwright E2E catch: ${e.getClass().getName()}: ${e.getMessage()}"
471+
if (handleFailFastAbort(e)) { return }
472+
throw e
473+
} finally {
474+
publishHTML([
475+
allowMissing : true,
476+
alwaysLinkToLastBuild: true,
477+
keepAll : true,
478+
reportDir : "functional-output/tests/playwright-e2e/odhin-report/",
479+
reportFiles : 'xui-playwright-e2e.html',
480+
reportName : 'AAT Playwright E2E'
481+
])
482+
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/tests/playwright-e2e/odhin-report/*'
483+
}
434484
}
435485
}
436486
}

0 commit comments

Comments
 (0)