Skip to content

Commit

Permalink
Fix parsing max-tests option (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrebeaucamp authored Nov 20, 2024
1 parent bd8a2ca commit 2ba7220
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions cmd/captain/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ func createRunCmd(cliArgs *CliArgs) *cobra.Command {
partitionTotal = provider.PartitionNodes.Total
}

if suiteConfig.Retries.MaxTests == "" && suiteConfig.Retries.MaxTestsLegacyName != "" {
suiteConfig.Retries.MaxTests = suiteConfig.Retries.MaxTestsLegacyName
}

runConfig = cli.RunConfig{
Args: args,
CloudOrganizationSlug: "deep_link",
Expand Down
7 changes: 4 additions & 3 deletions internal/cli/config_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ type SuiteConfigResults struct {
type SuiteConfigRetries struct {
Attempts int
Command string
FailFast bool `yaml:"fail-fast"`
FlakyAttempts int `yaml:"flaky-attempts"`
MaxTests string
FailFast bool `yaml:"fail-fast"`
FlakyAttempts int `yaml:"flaky-attempts"`
MaxTests string `yaml:"max-tests"`
MaxTestsLegacyName string `yaml:"maxtests"`
PostRetryCommands []string `yaml:"post-retry-commands"`
PreRetryCommands []string `yaml:"pre-retry-commands"`
IntermediateArtifactsPath string `yaml:"intermediate-artifacts-path"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test-suites:
command: ""
fail-fast: false
flaky-attempts: 0
maxtests: ""
max-tests: ""
post-retry-commands: []
pre-retry-commands: []
intermediate-artifacts-path: ""
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test-suites:
command: ""
fail-fast: false
flaky-attempts: 0
maxtests: ""
max-tests: ""
post-retry-commands: []
pre-retry-commands: []
intermediate-artifacts-path: ""
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test-suites:
command: ""
fail-fast: false
flaky-attempts: 0
maxtests: ""
max-tests: ""
post-retry-commands: []
pre-retry-commands: []
intermediate-artifacts-path: ""

0 comments on commit 2ba7220

Please sign in to comment.