-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I have added the initial frame for custom test flags. So far just the options to: - Skip setting up the devmapper thinpool - Skip deleting VMs - Skip all teardown steps - Set log level for containerd - Set log level for flintlockd Unfortunately custom test flags can only be added on `init()` which is bleh but I don't see another nice was of doing this. These flags can only be used while running `go test ...` directly. This means you cannot pass in flags as part of a `make` or a `docker run -it ...` command, but you can just call `go test etc` from inside the container or in the metal host and configure what you like. My next step is some more work around the python tooling so that these (and more) options can be passed up.
- Loading branch information
1 parent
d60a54e
commit d8a07b7
Showing
3 changed files
with
97 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//go:build e2e | ||
// +build e2e | ||
|
||
package utils | ||
|
||
import "flag" | ||
|
||
// Params groups all param. | ||
type Params struct { | ||
SkipSetupThinpool bool | ||
SkipTeardown bool | ||
SkipDelete bool | ||
ContainerdLogLevel string | ||
FlintlockdLogLevel string | ||
} | ||
|
||
// NewParams returns a new Params based on provided flags. | ||
func NewParams() *Params { | ||
params := Params{} | ||
|
||
flag.BoolVar(¶ms.SkipSetupThinpool, "skip.setup.thinpool", false, "Skip setting up devicemapper thinpools") | ||
flag.BoolVar(¶ms.SkipDelete, "skip.delete", false, "Skip running the 'delete vm' step of the tests (useful for debugging, this will also leave containerd and flintlockd running)") | ||
flag.BoolVar(¶ms.SkipTeardown, "skip.teardown", false, "Do not stop containerd or flintlockd after test exit (note: will require manual cleanup)") | ||
flag.StringVar(¶ms.ContainerdLogLevel, "level.containerd", "debug", "Set containerd's log level [trace, *debug*, info, warn, error, fatal, panic]") | ||
flag.StringVar(¶ms.FlintlockdLogLevel, "level.flintlockd", "0", "Set flintlockd's log level [A level of 2 and above is debug logging. A level of 9 and above is tracing.]") | ||
|
||
flag.Parse() | ||
|
||
return ¶ms | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters