Skip to content

Commit 90d3adf

Browse files
authored
fix: generate error when no tests are found (#788)
A Junit file may have testsuite tag without any tests. In vitest and cypress when a test can't be loaded
1 parent 7008dc0 commit 90d3adf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mergify_cli/ci/cli.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,14 @@ async def _process_junit_files( # noqa: PLR0913
236236
for span in spans
237237
if span.attributes is not None and span.attributes.get("test.scope") == "case"
238238
]
239+
240+
if not tests_cases:
241+
click.echo(
242+
click.style("❌ No test cases found in the JUnit files", fg="red"),
243+
err=True,
244+
)
245+
sys.exit(1)
246+
239247
nb_failing_spans = len(
240248
[
241249
span

0 commit comments

Comments
 (0)