Skip to content

Commit

Permalink
Don't set default parallelism for cloud runs (#36441)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsa0x authored Feb 6, 2025
1 parent acf478c commit 86295f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/command/arguments/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ func ParseTest(args []string) (*Test, tfdiags.Diagnostics) {
"The -junit-xml option is currently not compatible with remote test execution via the -cloud-run flag. If you are interested in JUnit XML output for remotely-executed tests please open an issue in GitHub."))
}

if test.OperationParallelism < 1 {
// Only set the default parallelism if this is not a cloud-run test.
// A cloud-run test will eventually run its own local test, and if the
// user still hasn't set the parallelism, that run will use the default.
if test.OperationParallelism < 1 && len(test.CloudRunSource) == 0 {
test.OperationParallelism = DefaultParallelism
}

Expand Down
12 changes: 12 additions & 0 deletions internal/command/arguments/test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ func TestParseTest(t *testing.T) {
},
wantDiags: nil,
},
"cloud-with-parallelism-0": {
args: []string{"-parallelism=0", "-cloud-run=foobar"},
want: &Test{
CloudRunSource: "foobar",
Filter: nil,
TestDirectory: "tests",
ViewType: ViewHuman,
Vars: &Vars{},
OperationParallelism: 0,
},
wantDiags: nil,
},
"unknown flag": {
args: []string{"-boop"},
want: &Test{
Expand Down

0 comments on commit 86295f5

Please sign in to comment.