Skip to content

Commit 86295f5

Browse files
authored
Don't set default parallelism for cloud runs (#36441)
1 parent acf478c commit 86295f5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

internal/command/arguments/test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ func ParseTest(args []string) (*Test, tfdiags.Diagnostics) {
7878
"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."))
7979
}
8080

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

internal/command/arguments/test_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,18 @@ func TestParseTest(t *testing.T) {
146146
},
147147
wantDiags: nil,
148148
},
149+
"cloud-with-parallelism-0": {
150+
args: []string{"-parallelism=0", "-cloud-run=foobar"},
151+
want: &Test{
152+
CloudRunSource: "foobar",
153+
Filter: nil,
154+
TestDirectory: "tests",
155+
ViewType: ViewHuman,
156+
Vars: &Vars{},
157+
OperationParallelism: 0,
158+
},
159+
wantDiags: nil,
160+
},
149161
"unknown flag": {
150162
args: []string{"-boop"},
151163
want: &Test{

0 commit comments

Comments
 (0)