Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick 1.3 showcase refactor #2192

2 changes: 1 addition & 1 deletion .ibm/pipelines/env_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HELM_IMAGE_NAME=backstage
HELM_REPO_NAME=rhdh-chart
HELM_REPO_URL="https://redhat-developer.github.io/rhdh-chart"
K8S_CLUSTER_TOKEN_ENCODED=$(printf "%s" $K8S_CLUSTER_TOKEN | base64 | tr -d '\n')
QUAY_REPO="${QUAY_REPO:-janus-idp/backstage-showcase}"
QUAY_REPO="${QUAY_REPO:-rhdh-community/rhdh}"

RELEASE_NAME=rhdh
RELEASE_NAME_RBAC=rhdh-rbac
Expand Down
12 changes: 7 additions & 5 deletions .ibm/pipelines/openshift-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ run_tests() {
local release_name=$1
local project=$2
cd "${DIR}/../../e2e-tests"
local e2e_tests_dir
e2e_tests_dir=$(pwd)
yarn install
yarn playwright install

Expand All @@ -215,16 +217,16 @@ 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

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
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ data:
- 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 @@ -101,7 +101,7 @@ data:
- 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/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
10 changes: 5 additions & 5 deletions .ibm/pipelines/value_files/values_showcase-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ global:
# -- Array of YAML files listing dynamic plugins to include with those listed in the `plugins` field.
# Relative paths are resolved from the working directory of the initContainer that will install the plugins (`/opt/app-root/src`).
includes:
# -- List of dynamic plugins included inside the `janus-idp/backstage-showcase` container image, some of which are disabled by default.
# This file ONLY works with the `janus-idp/backstage-showcase` container image.
# -- List of dynamic plugins included inside the `rhdh-community/rhdh` container image, some of which are disabled by default.
# This file ONLY works with the `rhdh-community/rhdh` container image.
- 'dynamic-plugins.default.yaml'

# -- List of dynamic plugins, possibly overriding the plugins listed in `includes` files.
Expand Down Expand Up @@ -134,9 +134,9 @@ upstream:
pullPolicy: Always
pullSecrets:
- rhdh-pull-secret
# using test image from https://quay.io/repository/janus-idp/backstage-showcase
# using test image from https://quay.io/repository/rhdh-community/rhdh
registry: quay.io
repository: janus-idp/backstage-showcase
repository: rhdh-community/rhdh
tag: next
command: []
# FIXME (tumido): USE POSTGRES_PASSWORD and POSTGRES_USER instead of POSTGRES_ADMIN_PASSWORD
Expand Down Expand Up @@ -254,7 +254,7 @@ upstream:
- name: install-dynamic-plugins
# -- Image used by the initContainer to install dynamic plugins into the `dynamic-plugins-root` volume mount.
# It could be replaced by a custom image based on this one.
# @default -- `quay.io/janus-idp/backstage-showcase:latest`
# @default -- `quay.io/rhdh-community/rhdh:next`
image: '{{ include "backstage.image" . }}'
command:
- sh
Expand Down
6 changes: 3 additions & 3 deletions .ibm/pipelines/value_files/values_showcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ global:
# -- Array of YAML files listing dynamic plugins to include with those listed in the `plugins` field.
# Relative paths are resolved from the working directory of the initContainer that will install the plugins (`/opt/app-root/src`).
includes:
# -- List of dynamic plugins included inside the `janus-idp/backstage-showcase` container image, some of which are disabled by default.
# This file ONLY works with the `janus-idp/backstage-showcase` container image.
# -- List of dynamic plugins included inside the `rhdh-community/rhdh` container image, some of which are disabled by default.
# This file ONLY works with the `rhdh-community/rhdh` container image.
- 'dynamic-plugins.default.yaml'

# -- List of dynamic plugins, possibly overriding the plugins listed in `includes` files.
Expand Down Expand Up @@ -137,7 +137,7 @@ upstream:
- rhdh-pull-secret
# using test image from https://quay.io/repository/janus-idp/backstage-showcase
registry: quay.io
repository: janus-idp/backstage-showcase
repository: rhdh-community/rhdh
tag: next
command: []
# FIXME (tumido): USE POSTGRES_PASSWORD and POSTGRES_USER instead of POSTGRES_ADMIN_PASSWORD
Expand Down
38 changes: 25 additions & 13 deletions e2e-tests/playwright/e2e/github-happy-path.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test.describe.serial('GitHub Happy path', () => {
let backstageShowcase: BackstageShowcase;

const component =
'https://github.com/janus-idp/backstage-showcase/blob/main/catalog-entities/all.yaml';
'https://github.com/redhat-developer/rhdh/blob/main/catalog-entities/all.yaml';

test.beforeAll(async ({ browser }, testInfo) => {
page = (await setupBrowser(browser, testInfo)).page;
Expand Down Expand Up @@ -84,6 +84,16 @@ test.describe.serial('GitHub Happy path', () => {
await uiHelper.selectMuiBox('Kind', 'Component');
await uiHelper.clickByDataTestId('user-picker-all');
await uiHelper.clickLink('Backstage Showcase');

const expectedPath = '/catalog/default/component/backstage-showcase';
// Wait for the expected path in the URL
await page.waitForURL(`**${expectedPath}`, {
waitUntil: 'domcontentloaded', // Wait until the DOM is loaded
timeout: 10000,
});
// Optionally, verify that the current URL contains the expected path
await expect(page.url()).toContain(expectedPath);

await common.clickOnGHloginPopup();
await uiHelper.verifyLink('Janus Website', { exact: false });
await backstageShowcase.verifyPRStatisticsRendered();
Expand Down Expand Up @@ -139,18 +149,20 @@ test.describe.serial('GitHub Happy path', () => {
await backstageShowcase.verifyPRRows(allPRs, lastPagePRs - 5, lastPagePRs);
});

//FIXME
test.skip('Verify that the 5, 10, 20 items per page option properly displays the correct number of PRs', async () => {
await uiHelper.openSidebar('Catalog');
await uiHelper.clickLink('Backstage Showcase');
await common.clickOnGHloginPopup();
await uiHelper.clickTab('Pull/Merge Requests');
await uiHelper.clickButton('ALL', { force: false });
const allPRs = await BackstageShowcase.getShowcasePRs('all');
await backstageShowcase.verifyPRRowsPerPage(5, allPRs);
await backstageShowcase.verifyPRRowsPerPage(10, allPRs);
await backstageShowcase.verifyPRRowsPerPage(20, allPRs);
});
test.fixme(
'Verify that the 5, 10, 20 items per page option properly displays the correct number of PRs',
async () => {
await uiHelper.openSidebar('Catalog');
await uiHelper.clickLink('test-entity');
await common.clickOnGHloginPopup();
await uiHelper.clickTab('Pull/Merge Requests');
await uiHelper.clickButton('ALL', { force: false });
const allPRs = await BackstageShowcase.getShowcasePRs('all');
await backstageShowcase.verifyPRRowsPerPage(5, allPRs);
await backstageShowcase.verifyPRRowsPerPage(10, allPRs);
await backstageShowcase.verifyPRRowsPerPage(20, allPRs);
},
);

test('Verify that the CI tab renders 5 most recent github actions and verify the table properly displays the actions when page sizes are changed and filters are applied', async () => {
await uiHelper.clickTab('CI');
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/playwright/e2e/plugins/quay/quay.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Common } from '../../../utils/Common';
import { ImageRegistry } from '../../../utils/quay/quay';

test.describe.skip('Test Quay.io plugin', () => {
const QUAY_REPOSITORY = 'janus-idp/backstage-showcase';
const QUAY_REPOSITORY = 'rhdh-community/rhdh';
let uiHelper: UIhelper;

test.beforeEach(async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/playwright/support/pages/CatalogImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class BackstageShowcase {

async verifyAboutCardIsDisplayed() {
const url =
'https://github.com/janus-idp/backstage-showcase/tree/main/catalog-entities/components/';
'https://github.com/redhat-developer/rhdh/tree/main/catalog-entities/components/';
const isLinkVisible = await this.page
.locator(`a[href="${url}"]`)
.isVisible();
Expand Down
Loading