Skip to content

Commit

Permalink
Add property flag to specify an offset for the result path
Browse files Browse the repository at this point in the history
Part of #403
  • Loading branch information
Munsio committed Feb 5, 2025
1 parent d2683d5 commit f847f76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/eval-dev-quality/cmd/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ type Evaluate struct {
Configuration string `long:"configuration" description:"Configuration file to set up an evaluation run."`
// ExecutionTimeout holds the timeout for an execution.
ExecutionTimeout uint `long:"execution-timeout" description:"Execution timeout for compilation and tests in minutes." default:"5"`
// RunIDOffset holds the offset increment for the run id used in creating the result folders.
RunIDOffset uint `long:"run-id-starts-at" description:"Sets the offset for the ID used in creating result folders." default:"1"`
// Runs holds the number of runs to perform.
Runs uint `long:"runs" description:"Number of runs to perform." default:"1"`
// RunsSequential indicates that interleaved runs are disabled and runs are performed sequentially.
Expand Down Expand Up @@ -175,6 +177,11 @@ func (command *Evaluate) Initialize(args []string) (evaluationContext *evaluate.
language.DefaultExecutionTimeout = time.Duration(command.ExecutionTimeout) * time.Minute
}

if command.RunIDOffset == 0 {
command.logger.Panicf("number of run-id-starts-at must be greater than zero")
}
evaluationContext.RunIDOffset = command.RunIDOffset

if command.Runs == 0 {
command.logger.Panicf("number of configured runs must be greater than zero")
}
Expand Down
2 changes: 2 additions & 0 deletions evaluate/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type Context struct {
// TestdataPath determines the testdata path where all repositories reside grouped by languages.
TestdataPath string

// RunIDOffset holds the offset for folders created when running a evaluation multiple times.
RunIDOffset uint
// Runs holds the number of runs to perform.
Runs uint
// RunsSequential indicates that interleaved runs are disabled and runs are performed sequentially.
Expand Down

0 comments on commit f847f76

Please sign in to comment.