From f70ac3c73a3b9db962d884fe3f463a77a78841b2 Mon Sep 17 00:00:00 2001 From: fellen31 Date: Thu, 24 Oct 2024 19:22:27 +0200 Subject: [PATCH] Fix error when trying to shard with no available tests --- src/main/java/com/askimed/nf/test/commands/RunTestsCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/askimed/nf/test/commands/RunTestsCommand.java b/src/main/java/com/askimed/nf/test/commands/RunTestsCommand.java index c96f34fd..f13a9dad 100644 --- a/src/main/java/com/askimed/nf/test/commands/RunTestsCommand.java +++ b/src/main/java/com/askimed/nf/test/commands/RunTestsCommand.java @@ -257,7 +257,7 @@ public Integer execute() throws Exception { List testSuits = testSuiteResolver.parse(scripts, new TagQuery(tags)); testSuits.sort(TestSuiteSorter.getDefault()); - if (shard != null) { + if (shard != null && !testSuits.isEmpty()) { if (shardStrategy.equalsIgnoreCase(SHARD_STRATEGY_ROUND_ROBIN)){ testSuits = TestSuiteSharder.shardWithRoundRobin(testSuits, shard); } else {