diff --git a/internal/command/arguments/test.go b/internal/command/arguments/test.go index bd5d3ec213..3a11394489 100644 --- a/internal/command/arguments/test.go +++ b/internal/command/arguments/test.go @@ -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 } diff --git a/internal/command/arguments/test_test.go b/internal/command/arguments/test_test.go index 018c961721..8d62bcb0e4 100644 --- a/internal/command/arguments/test_test.go +++ b/internal/command/arguments/test_test.go @@ -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{