Skip to content

Commit

Permalink
fix: rename duration to timeout (#55)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
eddycharly authored Oct 12, 2023
1 parent b614d53 commit 759fcbd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

This repository contains the tool used by kyverno for defining and running end to end tests.

It can be used to test any Kubernetes operator.
It can be used to test any Kubernetes operator.
2 changes: 1 addition & 1 deletion pkg/commands/test/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func Command() *cobra.Command {
return nil
},
}
cmd.Flags().DurationVar(&options.timeout.Duration, "duration", 30*time.Second, "The duration to use as default for configuration.")
cmd.Flags().DurationVar(&options.timeout.Duration, "timeout", 30*time.Second, "The timeout to use as default for configuration.")
cmd.Flags().StringVar(&options.config, "config", "", "Chainsaw configuration file.")
cmd.Flags().StringSliceVar(&options.testDirs, "testDirs", []string{}, "Directories containing test cases to run.")
cmd.Flags().BoolVar(&options.skipDelete, "skipDelete", false, "If set, do not delete the resources after running the tests.")
Expand Down
10 changes: 5 additions & 5 deletions pkg/commands/test/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ func TestChainsawCommand(t *testing.T) {
out: filepath.Join(basePath, "default.txt"),
},
{
name: "with duration",
name: "with timeout",
args: []string{
"--duration",
"--timeout",
"10s",
},
wantErr: false,
out: filepath.Join(basePath, "without_config.txt"),
},
{
name: "invalid duration",
name: "invalid timeout",
args: []string{
"--duration",
"--timeout",
"invalid",
},
wantErr: true,
Expand Down Expand Up @@ -118,7 +118,7 @@ func TestChainsawCommand(t *testing.T) {
args: []string{
"--config",
filepath.Join(basePath, "config/config_all_fields.yaml"),
"--duration",
"--timeout",
"10s",
},
wantErr: false,
Expand Down
2 changes: 1 addition & 1 deletion website/docs/commands/chainsaw_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ chainsaw test [flags]... [test directories]...

```
--config string Chainsaw configuration file.
--duration duration The duration to use as default for configuration. (default 30s)
--fullName Use full test case folder path instead of folder name.
-h, --help help for test
--namespace string Namespace to use for tests.
Expand All @@ -22,6 +21,7 @@ chainsaw test [flags]... [test directories]...
--stopOnFirstFailure Stop the test upon encountering the first failure.
--suppress strings Logs to suppress.
--testDirs strings Directories containing test cases to run.
--timeout duration The timeout to use as default for configuration. (default 30s)
```

### SEE ALSO
Expand Down

0 comments on commit 759fcbd

Please sign in to comment.