Skip to content

Commit

Permalink
fix: missing remote-secret label in remote secret tests (konflux-ci…
Browse files Browse the repository at this point in the history
…#994)

* fix labels

* gofmt
  • Loading branch information
rsoaresd authored Jan 29, 2024
1 parent 6fff246 commit 17caf68
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 29 deletions.
7 changes: 3 additions & 4 deletions pkg/clients/sprayproxy/sprayproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewSprayProxyConfig(url string, token string) (*SprayProxyConfig, error) {
},
},
},
Token: token,
Token: token,
}, nil
}

Expand All @@ -48,7 +48,7 @@ func (s *SprayProxyConfig) UnregisterServer(pacHost string) (string, error) {
if err != nil {
return "", err
}

result, err := s.sendRequest(http.MethodDelete, bytes.NewReader(bytesData))
if err != nil {
return "", err
Expand All @@ -64,7 +64,6 @@ func (s *SprayProxyConfig) GetServers() (string, error) {
return strings.TrimPrefix(result, "Backend urls:"), nil
}


func (s *SprayProxyConfig) sendRequest(httpMethod string, data io.Reader) (string, error) {
requestURL := s.BaseURL + "/backends"

Expand Down Expand Up @@ -117,4 +116,4 @@ func buildBodyData(pacHost string) ([]byte, error) {
return nil, err
}
return bytesData, nil
}
}
2 changes: 1 addition & 1 deletion pkg/utils/pipeline/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ type Log struct {
}
type Logs struct {
Record []Record `json:"records"`
}
}
2 changes: 1 addition & 1 deletion tests/release/pipelines/fbc_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func assertReleasePipelineRunSucceeded(devFw, managedFw framework.Framework, dev
func assertReleaseCRSucceeded(devFw framework.Framework, devNamespace, managedNamespace, fbcAppName string, component *appservice.Component) {
Eventually(func() error {
buildPr, err := devFw.AsKubeDeveloper.HasController.GetComponentPipelineRun(component.Name, fbcAppName, devNamespace, "")
if err != nil {
if err != nil {
return err
}
snapshot, err := devFw.AsKubeDeveloper.IntegrationController.GetSnapshot("", buildPr.Name, "", devNamespace)
Expand Down
8 changes: 4 additions & 4 deletions tests/release/releaseLib.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package common

import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
appservice "github.com/redhat-appstudio/application-api/api/v1alpha1"
"github.com/redhat-appstudio/e2e-tests/pkg/framework"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
appservice "github.com/redhat-appstudio/application-api/api/v1alpha1"
"github.com/redhat-appstudio/e2e-tests/pkg/framework"
)

func CreateComponentByCDQ(devFw framework.Framework, devNamespace, managedNamespace, appName, compName string, sourceGitURL string) *appservice.Component {
Expand Down
12 changes: 6 additions & 6 deletions tests/release/service/release_plan_and_admission_matched.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
. "github.com/onsi/gomega"
"github.com/redhat-appstudio/e2e-tests/pkg/framework"
"github.com/redhat-appstudio/e2e-tests/pkg/utils"
releaseApi "github.com/redhat-appstudio/release-service/api/v1alpha1"
releasecommon "github.com/redhat-appstudio/e2e-tests/tests/release"
releaseApi "github.com/redhat-appstudio/release-service/api/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand All @@ -23,7 +23,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("ReleasePlan and ReleasePlanAdmiss
var devNamespace string
var managedNamespace = utils.GetGeneratedNamespace("plan-and-admission-managed")

var releasePlanCR, secondReleasePlanCR *releaseApi.ReleasePlan
var releasePlanCR, secondReleasePlanCR *releaseApi.ReleasePlan
var releasePlanAdmissionCR *releaseApi.ReleasePlanAdmission
AfterEach(framework.ReportFailure(&fw))

Expand Down Expand Up @@ -100,7 +100,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("ReleasePlan and ReleasePlanAdmiss
Expect(condition).NotTo(BeNil())
Expect(condition.Status).To(Equal(metav1.ConditionTrue))
Expect(releasePlanAdmissionCR.Status.ReleasePlans).To(HaveLen(1))
Expect(releasePlanAdmissionCR.Status.ReleasePlans).To(Equal([]releaseApi.MatchedReleasePlan{{Name: devNamespace+ "/" + releasecommon.SourceReleasePlanName, Active: true}}))
Expect(releasePlanAdmissionCR.Status.ReleasePlans).To(Equal([]releaseApi.MatchedReleasePlan{{Name: devNamespace + "/" + releasecommon.SourceReleasePlanName, Active: true}}))
})
})

Expand Down Expand Up @@ -134,15 +134,15 @@ var _ = framework.ReleaseServiceSuiteDescribe("ReleasePlan and ReleasePlanAdmiss
return fmt.Errorf("failed to get the MatchedConditon of RPA %s ", releasePlanAdmissionCR.Name)
}

if len(releasePlanAdmissionCR.Status.ReleasePlans) < 2 {
if len(releasePlanAdmissionCR.Status.ReleasePlans) < 2 {
return fmt.Errorf("the second ReleasePlan CR has not being added to %s", releasePlanAdmissionCR.Name)
}
Expect(condition).NotTo(BeNil())
Expect(condition.Status).To(Equal(metav1.ConditionTrue))
return nil
}, releasecommon.ReleasePlanStatusUpdateTimeout, releasecommon.DefaultInterval).Should(Succeed(), fmt.Sprintf("time out when waiting for ReleasePlanAdmission %s being reconciled to matched", releasePlanAdmissionCR.Name))
Expect(releasePlanAdmissionCR.Status.ReleasePlans).To(HaveLen(2))
Expect(releasePlanAdmissionCR.Status.ReleasePlans).To(Equal([]releaseApi.MatchedReleasePlan{{Name: devNamespace+ "/" + releasecommon.SourceReleasePlanName, Active: true}, {Name: devNamespace + "/" + releasecommon.SecondReleasePlanName, Active: false}}))
Expect(releasePlanAdmissionCR.Status.ReleasePlans).To(Equal([]releaseApi.MatchedReleasePlan{{Name: devNamespace + "/" + releasecommon.SourceReleasePlanName, Active: true}, {Name: devNamespace + "/" + releasecommon.SecondReleasePlanName, Active: false}}))
})
})

Expand All @@ -161,7 +161,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("ReleasePlan and ReleasePlanAdmiss
return fmt.Errorf("failed to find the MatchedConditon of %s", releasePlanAdmissionCR.Name)
}

if len(releasePlanAdmissionCR.Status.ReleasePlans) > 1 {
if len(releasePlanAdmissionCR.Status.ReleasePlans) > 1 {
return fmt.Errorf("ReleasePlan CR is deleted, but ReleasePlanAdmission CR %s has not been reconciled", releasePlanAdmissionCR.Name)
}
Expect(condition).NotTo(BeNil())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
* More info: https://github.com/redhat-appstudio/image-controller#legacy-deprecated-component-image-repository
*/

var _ = framework.RemoteSecretSuiteDescribe(Label("component-annotation-image-pull-remote-secret"), func() {
var _ = framework.RemoteSecretSuiteDescribe(Label("remote-secret", "component-annotation-image-pull-remote-secret"), func() {

defer GinkgoRecover()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
* More info: https://github.com/redhat-appstudio/image-controller#general-purpose-image-repository
*/

var _ = framework.RemoteSecretSuiteDescribe(Label("image-repository-cr-image-pull-remote-secret"), func() {
var _ = framework.RemoteSecretSuiteDescribe(Label("remote-secret", "image-repository-cr-image-pull-remote-secret"), func() {

defer GinkgoRecover()

Expand Down
22 changes: 11 additions & 11 deletions tests/rhtap-demo/config/scenarios.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,14 @@ var TestScenarios = []TestSpec{
Stage: true,
Components: []ComponentSpec{
{
Name: "rhtap-stage-demo-component",
ContainerSource: "",
Language: "Java",
GitSourceUrl: "https://github.com/devfile-samples/devfile-sample-java-springboot-basic",
GitSourceRevision: "",
GitSourceContext: "",
HealthEndpoint: "/",
SkipDeploymentCheck: false,
Name: "rhtap-stage-demo-component",
ContainerSource: "",
Language: "Java",
GitSourceUrl: "https://github.com/devfile-samples/devfile-sample-java-springboot-basic",
GitSourceRevision: "",
GitSourceContext: "",
HealthEndpoint: "/",
SkipDeploymentCheck: false,
},
},
},
Expand All @@ -330,14 +330,14 @@ func GetScenarios(isStage bool) []TestSpec {
for _, Scenario := range TestScenarios {
if Scenario.Stage {
StageScenarios = append(StageScenarios, Scenario)
} else{
} else {
NormalScenarios = append(NormalScenarios, Scenario)
}
}

if isStage{
if isStage {
return StageScenarios
} else {
return NormalScenarios
}
}
}

0 comments on commit 17caf68

Please sign in to comment.