Skip to content

Commit

Permalink
Skip benchmarks if associated resource number is not set.
Browse files Browse the repository at this point in the history
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
  • Loading branch information
aznashwan committed May 5, 2022
1 parent 1aa81af commit 5757376
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/benchmark/container.go
Expand Up @@ -55,8 +55,8 @@ var _ = framework.KubeDescribe("Container", func() {
N: framework.TestContext.BenchmarkingParams.ContainersNumber,
NumParallel: framework.TestContext.BenchmarkingParams.ContainersNumberParallel,
}
if samplingConfig.N < 1 {
samplingConfig.N = 1
if samplingConfig.N <= 0 {
Skip("skipping container lifecycle benchmarks since container number option was not set")
}
if samplingConfig.NumParallel < 1 {
samplingConfig.NumParallel = 1
Expand Down
8 changes: 4 additions & 4 deletions pkg/benchmark/image.go
Expand Up @@ -94,8 +94,8 @@ var _ = framework.KubeDescribe("Image", func() {
N: framework.TestContext.BenchmarkingParams.ImagesNumber,
NumParallel: framework.TestContext.BenchmarkingParams.ImagesNumberParallel,
}
if samplingConfig.N < 1 {
samplingConfig.N = 1
if samplingConfig.N <= 0 {
Skip("skipping image lifecycle benchmarks since image number option was not set")
}
if samplingConfig.NumParallel < 1 {
samplingConfig.NumParallel = 1
Expand Down Expand Up @@ -187,8 +187,8 @@ var _ = framework.KubeDescribe("Image", func() {
N: framework.TestContext.BenchmarkingParams.ImagesNumber,
NumParallel: framework.TestContext.BenchmarkingParams.ImagesNumberParallel,
}
if samplingConfig.N < 1 {
samplingConfig.N = 1
if samplingConfig.N <= 0 {
Skip("skipping image listing benchmarks since image listing number option was not set")
}
if samplingConfig.NumParallel < 1 {
samplingConfig.NumParallel = 1
Expand Down
4 changes: 2 additions & 2 deletions pkg/benchmark/pod.go
Expand Up @@ -54,8 +54,8 @@ var _ = framework.KubeDescribe("PodSandbox", func() {
N: framework.TestContext.BenchmarkingParams.PodsNumber,
NumParallel: framework.TestContext.BenchmarkingParams.PodsNumberParallel,
}
if samplingConfig.N < 1 {
samplingConfig.N = 1
if samplingConfig.N <= 0 {
Skip("skipping pod lifecycle benchmarks since pod number option was not set")
}
if samplingConfig.NumParallel < 1 {
samplingConfig.NumParallel = 1
Expand Down

0 comments on commit 5757376

Please sign in to comment.