Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions tests/integration-service/gitlab-integration-reporting.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import (
"github.com/konflux-ci/e2e-tests/pkg/framework"
"github.com/konflux-ci/e2e-tests/pkg/utils"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

appstudioApi "github.com/konflux-ci/application-api/api/v1alpha1"
integrationv1beta2 "github.com/konflux-ci/integration-service/api/v1beta2"
. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -81,31 +78,18 @@ var _ = framework.IntegrationServiceSuiteDescribe("Gitlab Status Reporting of In

err = build.CreateGitlabBuildSecret(f, "gitlab-build-secret", secretAnnotations, gitlabToken)
Expect(err).ShouldNot(HaveOccurred())

secret := &v1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: "pipelines-as-code-secret",
Namespace: testNamespace,
},
Type: v1.SecretTypeOpaque,
StringData: map[string]string{
"password": gitlabToken,
},
}

// create a pipeline-as-code-secret in testNamespace
_, err = f.AsKubeAdmin.CommonController.CreateSecret(f.UserNamespace, secret)
Expect(err).NotTo(HaveOccurred())
})

AfterAll(func() {
if !CurrentSpecReport().Failed() {
// Cleanup test: close MR if opened, delete created branch, delete associated Webhooks and delete usersignup
Expect(f.AsKubeAdmin.CommonController.Gitlab.CloseMergeRequest(projectID, mrID)).NotTo(HaveOccurred())
Expect(f.AsKubeAdmin.CommonController.Gitlab.DeleteBranch(projectID, componentBaseBranchName)).NotTo(HaveOccurred())
Expect(f.AsKubeAdmin.CommonController.Gitlab.DeleteWebhooks(projectID, f.ClusterAppDomain)).NotTo(HaveOccurred())
Expect(f.AsKubeAdmin.HasController.DeleteApplication(applicationName, testNamespace, false)).To(Succeed())
Expect(f.SandboxController.DeleteUserSignup(f.UserName)).To(BeTrue())
}

// Cleanup test: close MR if opened, delete created branch, delete associated Webhooks
Expect(f.AsKubeAdmin.CommonController.Gitlab.CloseMergeRequest(projectID, mrID)).NotTo(HaveOccurred())
Expect(f.AsKubeAdmin.CommonController.Gitlab.DeleteBranch(projectID, componentBaseBranchName)).NotTo(HaveOccurred())
Expect(f.AsKubeAdmin.CommonController.Gitlab.DeleteWebhooks(projectID, f.ClusterAppDomain)).NotTo(HaveOccurred())
})

When("a new Component with specified custom branch is created", Label("custom-branch"), func() {
Expand Down