From 86295f518cea980fe538f24623cb70e44011a0bc Mon Sep 17 00:00:00 2001 From: Samsondeen <40821565+dsa0x@users.noreply.github.com> Date: Thu, 6 Feb 2025 08:54:08 +0100 Subject: [PATCH] Don't set default parallelism for cloud runs (#36441) --- internal/command/arguments/test.go | 5 ++++- internal/command/arguments/test_test.go | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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{