Skip to content

Commit 8d1bcb6

Browse files
committed
ci: fail ci if there are any invalid suite config
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
1 parent 4a3cf4d commit 8d1bcb6

1 file changed

Lines changed: 32 additions & 8 deletions

File tree

.drone.star

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,19 @@ def e2eTestsOnPlaywright(ctx):
642642
steps += filterTestSuitesToRun(ctx, params["features"])
643643
else:
644644
print("Error: No suites or features defined for e2e test suite '%s'" % suite)
645-
return []
645+
pipelines.append({
646+
"kind": "pipeline",
647+
"type": "docker",
648+
"name": "invalid-suite-%s" % suite,
649+
"steps": [{
650+
"name": "invalid-suite",
651+
"image": OC_CI_ALPINE_IMAGE,
652+
"commands": [
653+
"echo \"Error: No suites or features defined for e2e test suite '%s'\"" % suite,
654+
"exit 1",
655+
],
656+
}],
657+
})
646658

647659
steps += restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") + \
648660
installPnpm() + \
@@ -657,10 +669,10 @@ def e2eTestsOnPlaywright(ctx):
657669
if "keycloak" in suite:
658670
environment["KEYCLOAK"] = "true"
659671
environment["KEYCLOAK_HOST"] = "keycloak:8443"
660-
e2e_volumes += [{
672+
e2e_volumes.append({
661673
"name": "certs",
662674
"temp": {},
663-
}]
675+
})
664676
steps += keycloakService()
665677
services += postgresService()
666678

@@ -683,7 +695,7 @@ def e2eTestsOnPlaywright(ctx):
683695
steps += (tikaService() if params["tikaNeeded"] else []) + \
684696
ocisService(params["extraServerEnvironment"])
685697

686-
steps += [{
698+
steps.append({
687699
"name": "e2e-tests",
688700
"image": OC_CI_NODEJS_IMAGE,
689701
"environment": environment,
@@ -692,7 +704,7 @@ def e2eTestsOnPlaywright(ctx):
692704
"cd tests/e2e",
693705
"bash run-e2e.sh --type playwright",
694706
],
695-
}]
707+
})
696708

697709
if not "skip-a11y" in ctx.build.title.lower():
698710
steps += uploadA11yResult(ctx) + logA11yReport()
@@ -774,7 +786,19 @@ def e2eTests(ctx):
774786
steps += filterTestSuitesToRun(ctx, params["features"])
775787
else:
776788
print("Error: No suites or features defined for e2e test suite '%s'" % suite)
777-
return []
789+
pipelines.append({
790+
"kind": "pipeline",
791+
"type": "docker",
792+
"name": "invalid-suite-%s" % suite,
793+
"steps": [{
794+
"name": "invalid-suite",
795+
"image": OC_CI_ALPINE_IMAGE,
796+
"commands": [
797+
"echo \"Error: No suites or features defined for e2e test suite '%s'\"" % suite,
798+
"exit 1",
799+
],
800+
}],
801+
})
778802

779803
steps += restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") + \
780804
installPnpm() + \
@@ -789,10 +813,10 @@ def e2eTests(ctx):
789813
if "keycloak" in suite:
790814
environment["KEYCLOAK"] = "true"
791815
environment["KEYCLOAK_HOST"] = "keycloak:8443"
792-
e2e_volumes += [{
816+
e2e_volumes.append({
793817
"name": "certs",
794818
"temp": {},
795-
}]
819+
})
796820
steps += keycloakService()
797821
services += postgresService()
798822

0 commit comments

Comments
 (0)