mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
Add a way to run multiple suites with authelia-scripts.
Providing a list of suites test to authelia-scripts will run the tests of each of them sequentially. For instance, authelia-scripts suites test Standalone,BypassAll.
This commit is contained in:
parent
e0d4ed2a07
commit
da2b3b8370
|
@ -183,14 +183,16 @@ func testSuite(cmd *cobra.Command, args []string) {
|
|||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// If suite(s) are provided as argument
|
||||
if len(args) == 1 {
|
||||
suite := args[0]
|
||||
suiteArg := args[0]
|
||||
|
||||
if runningSuite != "" && suite != runningSuite {
|
||||
log.Fatal(errors.New("Running suite (" + runningSuite + ") is different than suite to be tested (" + suite + "). Shutdown running suite and retry"))
|
||||
if runningSuite != "" && suiteArg != runningSuite {
|
||||
log.Fatal(errors.New("Running suite (" + runningSuite + ") is different than suite(s) to be tested (" + suiteArg + "). Shutdown running suite and retry"))
|
||||
}
|
||||
|
||||
if err := runSuiteTests(suite, runningSuite == ""); err != nil {
|
||||
suiteNames := strings.Split(suiteArg, ",")
|
||||
if err := runMultipleSuitesTests(suiteNames, runningSuite == ""); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
} else {
|
||||
|
@ -263,6 +265,15 @@ func runSuiteTests(suiteName string, withEnv bool) error {
|
|||
return testErr
|
||||
}
|
||||
|
||||
func runMultipleSuitesTests(suiteNames []string, withEnv bool) error {
|
||||
for _, suiteName := range suiteNames {
|
||||
if err := runSuiteTests(suiteName, withEnv); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func runAllSuites() error {
|
||||
log.Info("Start running all suites")
|
||||
for _, s := range listSuites() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user