Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/konflux-ci/e2e-tests into p…
Browse files Browse the repository at this point in the history
…ush_disk_images_to_cdn
  • Loading branch information
jinqi7 committed Sep 27, 2024
2 parents 7a96dbc + 7c9fa2d commit 076cef8
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 27 deletions.
4 changes: 2 additions & 2 deletions integration-tests/pipelines/konflux-e2e-tests-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ spec:
- name: cloud-credential-key
value: "$(params.cloud-credential-key)"
- name: konflux-e2e-tests
timeout: 2h
timeout: 3h
when:
- input: "$(tasks.test-metadata.results.test-event-type)"
operator: in
Expand Down Expand Up @@ -250,4 +250,4 @@ spec:
- name: git-org
value: "$(tasks.test-metadata.results.git-org)"
- name: git-revision
value: "$(tasks.test-metadata.results.git-revision)"
value: "$(tasks.test-metadata.results.git-revision)"
24 changes: 16 additions & 8 deletions integration-tests/scripts/konflux-e2e-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,25 @@ done
log "INFO" "running tests with github user: ${GITHUB_USER}"

# ROSA HCP workaround for Docker limits
oc create namespace konflux-otel
oc create sa open-telemetry-opentelemetry-collector -n konflux-otel

# for namespaces 'minio-operator' and 'tekton-results'
oc get secret/pull-secret -n openshift-config --template='{{index .data ".dockerconfigjson" | base64decode}}' > ./global-pull-secret.json
oc get secret -n openshift-config -o yaml pull-secret > global-pull-secret.yaml
yq -i '.metadata.namespace = "konflux-otel"' global-pull-secret.yaml

yq -i e 'del(.metadata.namespace)' global-pull-secret.yaml
oc registry login --registry=docker.io --auth-basic="$DOCKER_IO_AUTH" --to=./global-pull-secret.json
oc apply -f global-pull-secret.yaml -n konflux-otel
oc set data secret/pull-secret -n konflux-otel --from-file=.dockerconfigjson=./global-pull-secret.json
oc secrets link open-telemetry-opentelemetry-collector pull-secret --for=pull -n konflux-otel

namespace_sa_names=$(cat << 'EOF'
minio-operator|minio-operator
tekton-results|storage-sa
EOF
)
while IFS='|' read -r ns sa_name; do
oc create namespace "$ns" --dry-run=client -o yaml | oc apply -f -
oc create sa "$sa_name" -n "$ns" --dry-run=client -o yaml | oc apply -f -
oc apply -f global-pull-secret.yaml -n "$ns"
oc set data secret/pull-secret -n "$ns" --from-file=.dockerconfigjson=./global-pull-secret.json
oc secrets link "$sa_name" pull-secret --for=pull -n "$ns"
done <<< "$namespace_sa_names"


# Prepare git, pair branch if necessary, Install Konflux and run e2e tests
cd "$(mktemp -d)"
Expand Down
8 changes: 4 additions & 4 deletions tests/build/build_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,11 +694,11 @@ var _ = framework.BuildSuiteDescribe("Build templates E2E test", Label("build",
Expect(err).NotTo(HaveOccurred())

// The logs from the report step are used by the UI to display validation
// details. Let's make sure it has valid YAML.
reportLogs := logs["step-report"]
// details. Let's make sure it has valid JSON.
reportLogs := logs["step-report-json"]
Expect(reportLogs).NotTo(BeEmpty())
var reportYAML any
err = yaml.Unmarshal([]byte(reportLogs), &reportYAML)
var report any
err = json.Unmarshal([]byte(reportLogs), &report)
Expect(err).NotTo(HaveOccurred())

// The logs from the summary step are used by the UI to display an overview of
Expand Down
24 changes: 12 additions & 12 deletions tests/enterprise-contract/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ var _ = framework.EnterpriseContractSuiteDescribe("Enterprise Contract E2E tests
ContainElements(tekton.MatchTaskRunResultWithJSONPathValue(constants.OldTektonTaskTestOutputName, "{$.result}", `["FAILURE"]`)),
ContainElements(tekton.MatchTaskRunResultWithJSONPathValue(constants.TektonTaskTestOutputName, "{$.result}", `["FAILURE"]`)),
))
//Get container step-report log details from pod
reportLog, err := utils.GetContainerLogs(fwk.AsKubeAdmin.CommonController.KubeInterface(), tr.Status.PodName, "step-report", namespace)
GinkgoWriter.Printf("*** Logs from pod '%s', container '%s':\n----- START -----%s----- END -----\n", tr.Status.PodName, "step-report", reportLog)
//Get container step-report-json log details from pod
reportLog, err := utils.GetContainerLogs(fwk.AsKubeAdmin.CommonController.KubeInterface(), tr.Status.PodName, "step-report-json", namespace)
GinkgoWriter.Printf("*** Logs from pod '%s', container '%s':\n----- START -----%s----- END -----\n", tr.Status.PodName, "step-report-json", reportLog)
Expect(err).NotTo(HaveOccurred())
Expect(reportLog).Should(ContainSubstring("No image attestations found matching the given public key"))
})
Expand Down Expand Up @@ -371,9 +371,9 @@ var _ = framework.EnterpriseContractSuiteDescribe("Enterprise Contract E2E tests
ContainElements(tekton.MatchTaskRunResultWithJSONPathValue(constants.OldTektonTaskTestOutputName, "{$.result}", `["SUCCESS"]`)),
ContainElements(tekton.MatchTaskRunResultWithJSONPathValue(constants.TektonTaskTestOutputName, "{$.result}", `["SUCCESS"]`)),
))
//Get container step-report log details from pod
reportLog, err := utils.GetContainerLogs(fwk.AsKubeAdmin.CommonController.KubeInterface(), tr.Status.PodName, "step-report", namespace)
GinkgoWriter.Printf("*** Logs from pod '%s', container '%s':\n----- START -----%s----- END -----\n", tr.Status.PodName, "step-report", reportLog)
//Get container step-report-json log details from pod
reportLog, err := utils.GetContainerLogs(fwk.AsKubeAdmin.CommonController.KubeInterface(), tr.Status.PodName, "step-report-json", namespace)
GinkgoWriter.Printf("*** Logs from pod '%s', container '%s':\n----- START -----%s----- END -----\n", tr.Status.PodName, "step-report-json", reportLog)
Expect(err).NotTo(HaveOccurred())
})
})
Expand Down Expand Up @@ -454,9 +454,9 @@ var _ = framework.EnterpriseContractSuiteDescribe("Enterprise Contract E2E tests
ContainElements(tekton.MatchTaskRunResultWithJSONPathValue(constants.TektonTaskTestOutputName, "{$.result}", `["FAILURE"]`)),
))

//Get container step-report log details from pod
reportLog, err := utils.GetContainerLogs(fwk.AsKubeAdmin.CommonController.KubeInterface(), tr.Status.PodName, "step-report", namespace)
GinkgoWriter.Printf("*** Logs from pod '%s', container '%s':\n----- START -----%s----- END -----\n", tr.Status.PodName, "step-report", reportLog)
//Get container step-report-json log details from pod
reportLog, err := utils.GetContainerLogs(fwk.AsKubeAdmin.CommonController.KubeInterface(), tr.Status.PodName, "step-report-json", namespace)
GinkgoWriter.Printf("*** Logs from pod '%s', container '%s':\n----- START -----%s----- END -----\n", tr.Status.PodName, "step-report-json", reportLog)
Expect(err).NotTo(HaveOccurred())
Expect(reportLog).Should(MatchRegexp(`Pipeline task .* uses an (?:untrusted|unacceptable) task bundle`))
})
Expand Down Expand Up @@ -494,9 +494,9 @@ var _ = framework.EnterpriseContractSuiteDescribe("Enterprise Contract E2E tests
ContainElements(tekton.MatchTaskRunResultWithJSONPathValue(constants.TektonTaskTestOutputName, "{$.result}", `["WARNING"]`)),
))

//Get container step-report log details from pod
reportLog, err := utils.GetContainerLogs(fwk.AsKubeAdmin.CommonController.KubeInterface(), tr.Status.PodName, "step-report", namespace)
GinkgoWriter.Printf("*** Logs from pod '%s', container '%s':\n----- START -----%s----- END -----\n", tr.Status.PodName, "step-report", reportLog)
//Get container step-report-json log details from pod
reportLog, err := utils.GetContainerLogs(fwk.AsKubeAdmin.CommonController.KubeInterface(), tr.Status.PodName, "step-report-json", namespace)
GinkgoWriter.Printf("*** Logs from pod '%s', container '%s':\n----- START -----%s----- END -----\n", tr.Status.PodName, "step-report-json", reportLog)
Expect(err).NotTo(HaveOccurred())
Expect(reportLog).Should(MatchRegexp(`Pipeline task .* uses an unpinned task bundle reference`))
})
Expand Down
2 changes: 1 addition & 1 deletion tests/release/pipelines/push_disk_images_to_cdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func createRHAIReleasePlanAdmission(rhaiRPAName string, managedFw framework.Fram
},
"tags": []string{"time-{{ timestamp }}", "git-{{ git_sha }}" },
"cdn": map[string]interface{}{
"env": "qa",
"env": "stage",
},
})
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit 076cef8

Please sign in to comment.