Skip to content

Commit

Permalink
Check for status failed
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmeku committed Apr 29, 2024
1 parent eda9d77 commit 4748cb8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions cypress/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ def cypress_module_test(name, runner, cypress = "//:node_modules/cypress", **kwa
cypress.run({
headless: true,
}).then(result => {
// Cypress only reports a status on failures
if (result.status) {
if (result.status === 'failed') {
process.exit(1);
}
})
Expand Down
3 changes: 1 addition & 2 deletions docs/defs.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions docs/rules.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions e2e/workspace/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ local_path_override(
module_name = "aspect_rules_cypress",
path = "../..",
)

cypress = use_extension("@aspect_rules_cypress//cypress:extensions.bzl", "cypress")
cypress.toolchain(cypress_version = "13.6.6")
use_repo(cypress, "cypress_toolchains")

register_toolchains("@cypress_toolchains//:all")

bazel_dep(name = "aspect_rules_js", version = "1.41.2", dev_dependency = True)
Expand Down
4 changes: 1 addition & 3 deletions e2e/workspace/module_test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ async function main() {
return 1;
}

// Cypress only reports a status on failures
if (result.status) {
console.error("Cypress tests failed with status", result.status);
if (result.status === "failed") {
return 2;
}

Expand Down

0 comments on commit 4748cb8

Please sign in to comment.