Skip to content

Commit

Permalink
SRVKP-6722 new tests for versioned ecosystem tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
jayesh-garg committed Feb 6, 2025
1 parent 4fa33dc commit 9890596
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 5 deletions.
30 changes: 25 additions & 5 deletions specs/operator/addon.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PIPELINES-15
Pre condition:
* Validate Operator should be installed

## Disable/Enable resolverTasks: PIPELINES-15-TC06
## Disable/Enable resolverTasks: PIPELINES-15-TC01
Tags: e2e, integration, resolvertasks, admin, addon, sanity
Component: Pipelines
Level: Integration
Expand All @@ -17,7 +17,7 @@ Steps:
* Update addon config with resolverTasks as "true" and expect message ""
* Tasks "s2i-java" are "present" in namespace "openshift-pipelines"

## Disable/Enable resolverTasks with additional Tasks: PIPELINES-15-TC07
## Disable/Enable resolverTasks with additional Tasks: PIPELINES-15-TC02
Tags: e2e, integration, resolvertasks, admin, addon
Component: Pipelines
Level: Integration
Expand All @@ -39,7 +39,7 @@ Steps:
* Tasks "s2i-java" are "present" in namespace "openshift-pipelines"
* Tasks "hello" are "present" in namespace "openshift-pipelines"

## Disable/Enable pipeline templates: PIPELINES-15-TC08
## Disable/Enable pipeline templates: PIPELINES-15-TC03
Tags: e2e, integration, resolvertasks, admin, addon, sanity
Component: Pipelines
Level: Integration
Expand All @@ -54,7 +54,7 @@ Steps:
* Update addon config with resolverTasks as "true" and pipelineTemplates as "true" and expect message ""
* Assert pipelines are "present" in "openshift" namespace

## Enable pipeline templates when clustertask is disabled: PIPELINES-15-TC05
## Enable pipeline templates when clustertask is disabled: PIPELINES-15-TC04
Tags: e2e, integration, negative, admin, addon
Component: Pipelines
Level: Integration
Expand All @@ -63,4 +63,24 @@ Importance: Critical
Pos/Neg: Negative

Steps:
* Update addon config with resolverTasks as "false" and pipelineTemplates as "true" and expect message "validation failed: pipelineTemplates cannot be true if resolverTask is false"
* Update addon config with resolverTasks as "false" and pipelineTemplates as "true" and expect message "validation failed: pipelineTemplates cannot be true if resolverTask is false"

## Verify versioned ecosystem tasks: PIPELINES-15-TC05
Tags: e2e, integration, addon
Component: Pipelines
Level: Integration
Type: Functional
Importance: Critical

Steps:
* Verify versioned ecosystem tasks

## Verify versioned stepaction tasks: PIPELINES-15-TC06
Tags: e2e, integration, addon
Component: Pipelines
Level: Integration
Type: Functional
Importance: Critical

Steps:
* Verify versioned stepaction tasks
29 changes: 29 additions & 0 deletions steps/cli/oc.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/getgauge-contrib/gauge-go/gauge"
m "github.com/getgauge-contrib/gauge-go/models"
"github.com/getgauge-contrib/gauge-go/testsuit"
"github.com/openshift-pipelines/release-tests/pkg/cmd"
"github.com/openshift-pipelines/release-tests/pkg/oc"
"github.com/openshift-pipelines/release-tests/pkg/openshift"
"github.com/openshift-pipelines/release-tests/pkg/store"
Expand Down Expand Up @@ -165,6 +166,34 @@ var _ = gauge.Step("Update addon config with resolverStepActions as <resolverSte
}
})

var _ = gauge.Step("Verify versioned ecosystem tasks", func() {
taskList := cmd.MustSucceed("oc", "get", "task", "-n", "openshift-pipelines").Stdout()
requiredTasks := []string{"buildah", "git-cli", "git-clone", "kn", "kn-apply", "maven", "openshift-client", "s2i-dotnet", "s2i-go", "s2i-java", "s2i-nodejs", "s2i-perl", "s2i-php", "s2i-python", "s2i-ruby", "skopeo-copy", "tkn"}
requiredVersions := []string{"1-16-0", "1-17-0"}
for _, task := range requiredTasks {
for _, version := range requiredVersions {
taskWithVersion := task + "-" + version
if !strings.Contains(taskList, taskWithVersion) {
testsuit.T.Errorf("Failed to test versioned task, No task found: %s", taskWithVersion)
}
}
}
})

var _ = gauge.Step("Verify versioned stepaction tasks", func() {
taskList := cmd.MustSucceed("oc", "get", "stepaction", "-n", "openshift-pipelines").Stdout()
requiredTasks := []string{"git-clone"}
requiredVersions := []string{"1-16-0", "1-17-0"}
for _, task := range requiredTasks {
for _, version := range requiredVersions {
taskWithVersion := task + "-" + version
if !strings.Contains(taskList, taskWithVersion) {
testsuit.T.Errorf("Failed to test versioned stepaction, No stepaction found: %s", taskWithVersion)
}
}
}
})

var _ = gauge.Step("Create project <projectName>", func(projectName string) {
log.Printf("Check if project %v already exists", projectName)
if oc.CheckProjectExists(projectName) {
Expand Down

0 comments on commit 9890596

Please sign in to comment.