Skip to content

Commit

Permalink
chore(ci): refactor hardcoded backstage-showcase in e2e tests (redhat…
Browse files Browse the repository at this point in the history
…-developer#2172)

* chore(ci): refactor hardcoded backstage-showcase in e2e tests

* Fix declaration

* Fix cp *
  • Loading branch information
zdrapela authored Jan 13, 2025
1 parent b0f0efe commit 73d8bff
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ catalog:
- allow: [API, Component, Group, Location, Resource, System, Template]
locations:
- type: url
target: https://github.com/janus-idp/backstage-showcase/blob/main/catalog-entities/all.yaml
target: https://github.com/redhat-developer/rhdh/blob/main/catalog-entities/all.yaml
- type: url
target: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/main/templates.yaml
- type: url
Expand Down
2 changes: 1 addition & 1 deletion .ibm/pipelines/resources/config_map/app-config-rhdh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ catalog:
- allow: [API, Component, Group, Location, Resource, System, Template]
locations:
- type: url
target: https://github.com/janus-idp/backstage-showcase/blob/main/catalog-entities/all.yaml
target: https://github.com/redhat-developer/rhdh/blob/main/catalog-entities/all.yaml
- type: url
target: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/main/templates.yaml
- type: url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ dynamicPlugins:
* [Website](https://developers.redhat.com/rhdh/overview)
* [Documentation](https://docs.redhat.com/en/documentation/red_hat_developer_hub/)
* [GitHub Showcase](https://github.com/janus-idp/backstage-showcase)
* [GitHub Showcase](https://github.com/redhat-developer/rhdh)
* [GitHub Plugins](https://github.com/janus-idp/backstage-plugins)
- mountPoint: home.page/cards
importName: Markdown
Expand All @@ -137,7 +137,7 @@ dynamicPlugins:
* [Website](https://developers.redhat.com/rhdh/overview)
* [Documentation](https://docs.redhat.com/en/documentation/red_hat_developer_hub/)
* [GitHub Showcase](https://github.com/janus-idp/backstage-showcase)
* [GitHub Showcase](https://github.com/redhat-developer/rhdh)
* [GitHub Plugins](https://github.com/janus-idp/backstage-plugins)
- mountPoint: home.page/cards
importName: FeaturedDocsCard
Expand Down
19 changes: 11 additions & 8 deletions .ibm/pipelines/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ droute_send() {
ARTIFACTS_URL="https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/${REPO_OWNER}_${REPO_NAME}/${PULL_NUMBER}/${JOB_NAME}/${BUILD_ID}/artifacts/e2e-tests/${REPO_OWNER}-${REPO_NAME}/artifacts/${project}"
else
JOB_URL="${JOB_BASE_URL}/logs/${JOB_NAME}/${BUILD_ID}"
ARTIFACTS_URL="https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/logs/${JOB_NAME}/${BUILD_ID}/artifacts/${JOB_NAME##periodic-ci-janus-idp-backstage-showcase-main-}/${REPO_OWNER}-${REPO_NAME}/artifacts/${project}"
ARTIFACTS_URL="https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/logs/${JOB_NAME}/${BUILD_ID}/artifacts/${JOB_NAME##periodic-ci-redhat-developer-rhdh-main-}/${REPO_OWNER}-${REPO_NAME}/artifacts/${project}"
fi

# Remove properties (only used for skipped test and invalidates the file if empty)
Expand Down Expand Up @@ -540,6 +540,9 @@ run_tests() {
local project=$2
project=${project}
cd "${DIR}/../../e2e-tests"
local e2e_tests_dir
e2e_tests_dir=$(pwd)

yarn install
yarn playwright install chromium

Expand All @@ -558,20 +561,20 @@ run_tests() {

mkdir -p "${ARTIFACT_DIR}/${project}/test-results"
mkdir -p "${ARTIFACT_DIR}/${project}/attachments/screenshots"
cp -a /tmp/backstage-showcase/e2e-tests/test-results/* "${ARTIFACT_DIR}/${project}/test-results"
cp -a /tmp/backstage-showcase/e2e-tests/${JUNIT_RESULTS} "${ARTIFACT_DIR}/${project}/${JUNIT_RESULTS}"
cp -a "${e2e_tests_dir}/test-results/"* "${ARTIFACT_DIR}/${project}/test-results"
cp -a "${e2e_tests_dir}/${JUNIT_RESULTS}" "${ARTIFACT_DIR}/${project}/${JUNIT_RESULTS}"

if [ -d "/tmp/backstage-showcase/e2e-tests/screenshots" ]; then
cp -a /tmp/backstage-showcase/e2e-tests/screenshots/* "${ARTIFACT_DIR}/${project}/attachments/screenshots/"
if [ -d "${e2e_tests_dir}/screenshots" ]; then
cp -a "${e2e_tests_dir}/screenshots/"* "${ARTIFACT_DIR}/${project}/attachments/screenshots/"
fi

if [ -d "/tmp/backstage-showcase/e2e-tests/auth-providers-logs" ]; then
cp -a /tmp/backstage-showcase/e2e-tests/auth-providers-logs/* "${ARTIFACT_DIR}/${project}/"
if [ -d "${e2e_tests_dir}/auth-providers-logs" ]; then
cp -a "${e2e_tests_dir}/auth-providers-logs/"* "${ARTIFACT_DIR}/${project}/"
fi

ansi2html <"/tmp/${LOGFILE}" >"/tmp/${LOGFILE}.html"
cp -a "/tmp/${LOGFILE}.html" "${ARTIFACT_DIR}/${project}"
cp -a /tmp/backstage-showcase/e2e-tests/playwright-report/* "${ARTIFACT_DIR}/${project}"
cp -a "${e2e_tests_dir}/playwright-report/"* "${ARTIFACT_DIR}/${project}"

droute_send "${release_name}" "${project}"

Expand Down

0 comments on commit 73d8bff

Please sign in to comment.