Skip to content

Commit

Permalink
Revert "fix - Slice the build target list to 1 when running gradle te…
Browse files Browse the repository at this point in the history
…sts (microsoft#1518)"

This reverts commit d904c27.
  • Loading branch information
Developmentally-1nSANe authored Jul 16, 2024
1 parent d904c27 commit 7ebdcff
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,9 @@ public Object executeCommand(String commandId, List<Object> arguments, IProgress
List<BuildTargetIdentifier> btIds = targets.stream().filter(bt -> {
return bt.getTags().contains(BuildTargetTag.INTEGRATION_TEST) || bt.getTags().contains(BuildTargetTag.TEST);
}).map(BuildTarget::getId).collect(Collectors.toList());
if (btIds.isEmpty()) {
if (btIds.isEmpty() || btIds.size() > 1) {
throw new IllegalStateException("Invalid number of build targets: " + btIds.size());
}

if (btIds.size() > 1) {
// The build server only allows to accept one build target per test request. At client side,
// each test request is sent per project, so even multiple build targets are found, they
// belongs to the same project. Thus, we only use the first one here. Build server will use
// this single build target to locate the project to test.
btIds = btIds.subList(0, 1);
}
TestParams testParams = new TestParams(btIds);
testParams.setDataKind("scala-test-suites-selection");
testParams.setArguments(getArguments(arguments));
Expand All @@ -72,8 +64,8 @@ public Object executeCommand(String commandId, List<Object> arguments, IProgress
}
ScalaTestSuites scalaTestSuites = new ScalaTestSuites(
testSelections,
getJvmOptions(arguments),
getEnvVarPairs(arguments)
getJvmOptions(arguments), // jvmOptions
getEnvVarPairs(arguments) // envVariables
);
testParams.setData(scalaTestSuites);
buildServerConnection.buildTargetTest(testParams).join();
Expand Down

0 comments on commit 7ebdcff

Please sign in to comment.