Skip to content

Commit dc3621a

Browse files
committed
Add parallelism to create options for TF Test Runs
1 parent 5630634 commit dc3621a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

test_run.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ type TestRunCreateOptions struct {
117117
// executed by this TestRun.
118118
Verbose *bool `jsonapi:"attr,verbose,omitempty"`
119119

120+
// Parallelism controls the number of parallel operations to execute within a single test run.
121+
Parallelism *int `jsonapi:"attr,parallelism,omitempty"`
122+
120123
// Variables allows you to specify terraform input variables for
121124
// a particular run, prioritized over variables defined on the workspace.
122125
Variables []*RunVariable `jsonapi:"attr,variables,omitempty"`

test_run_integration_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ func TestTestRunsCreate(t *testing.T) {
140140
_, err := client.TestRuns.Create(ctx, options)
141141
require.NoError(t, err)
142142
})
143+
144+
p := 10
145+
t.Run("with a custom parallelism version", func(t *testing.T) {
146+
options := TestRunCreateOptions{
147+
ConfigurationVersion: cvTest,
148+
RegistryModule: rmTest,
149+
Parallelism: &p,
150+
}
151+
_, err := client.TestRuns.Create(ctx, options)
152+
require.NoError(t, err)
153+
})
154+
143155
t.Run("without a configuration version", func(t *testing.T) {
144156
options := TestRunCreateOptions{
145157
RegistryModule: rmTest,

0 commit comments

Comments
 (0)