forked from ooni/probe-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runx.go
32 lines (28 loc) · 915 Bytes
/
runx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
//
// Run eXperiment by name
//
import (
"context"
"github.com/ooni/probe-cli/v3/internal/oonirun"
"github.com/ooni/probe-cli/v3/internal/runtimex"
)
// runx runs the given experiment by name
func runx(ctx context.Context, sess oonirun.Session, experimentName string,
annotations map[string]string, extraOptions map[string]any, currentOptions *Options) {
desc := &oonirun.Experiment{
Annotations: annotations,
ExtraOptions: extraOptions,
Inputs: currentOptions.Inputs,
InputFilePaths: currentOptions.InputFilePaths,
MaxRuntime: currentOptions.MaxRuntime,
Name: experimentName,
NoCollector: currentOptions.NoCollector,
NoJSON: currentOptions.NoJSON,
Random: currentOptions.Random,
ReportFile: currentOptions.ReportFile,
Session: sess,
}
err := desc.Run(ctx)
runtimex.PanicOnError(err, "cannot run experiment")
}