Skip to content

Commit

Permalink
chore(e2e-tests): enable tech radar plugin tests (#1963)
Browse files Browse the repository at this point in the history
* chore(e2e-tests): Enable tech radar plugin tests

Signed-off-by: Kashish Mittal <[email protected]>

* update e2e-tests config

Signed-off-by: Kashish Mittal <[email protected]>

* update tech radar e2e tests

Signed-off-by: Kashish Mittal <[email protected]>

* update tech radar e2e tests

Signed-off-by: Kashish Mittal <[email protected]>

* use UI_HELPER_ELEMENTS instead of UIhelperPO in tech radar tests

Signed-off-by: Kashish Mittal <[email protected]>

* update e2e test config to include techRadar

Signed-off-by: Kashish Mittal <[email protected]>

* update secrets-rhdh-secrets.yaml

Signed-off-by: Kashish Mittal <[email protected]>

* add host for service rendering tech radar data

Signed-off-by: Kashish Mittal <[email protected]>

* add url for service rendering tech radar data

Signed-off-by: Kashish Mittal <[email protected]>

* update tech radar related config

Signed-off-by: Kashish Mittal <[email protected]>

* make tech radar tests PR friendly

* encode DH_TARGET_URL before converting adding it to secrets

* always set DH_TARGET_URL not just in PR tests

---------

Signed-off-by: Kashish Mittal <[email protected]>
Co-authored-by: Omar Al Jaljuli <[email protected]>
  • Loading branch information
04kash and Omar-AlJaljuli authored Dec 5, 2024
1 parent b7d254b commit 4f7d6c4
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .ibm/pipelines/auth/secrets-rhdh-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ data:
KEYCLOAK_CLIENT_ID: bXljbGllbnQ=
KEYCLOAK_CLIENT_SECRET: dGVtcA==
ACR_SECRET: dGVtcA==
DH_TARGET_URL: aHR0cDovL3Rlc3QtYmFja3N0YWdlLWN1c3RvbWl6YXRpb24tcHJvdmlkZXItc2hvd2Nhc2UtY2kucmhkaC1wci1vcy1hOTgwNTY1MDgzMGIyMmMzYWVlMjQzZTUxZDc5NTY1ZC0wMDAwLnVzLWVhc3QuY29udGFpbmVycy5hcHBkb21haW4uY2xvdWQ=
DH_TARGET_URL: dGVzdC1iYWNrc3RhZ2UtY3VzdG9taXphdGlvbi1wcm92aWRlci1zaG93Y2FzZS1jaS5yaGRoLXByLW9zLWE5ODA1NjUwODMwYjIyYzNhZWUyNDNlNTFkNzk1NjVkLTAwMDAudXMtZWFzdC5jb250YWluZXJzLmFwcGRvbWFpbi5jbG91ZA==
GOOGLE_CLIENT_ID: dGVtcA==
GOOGLE_CLIENT_SECRET: dGVtcA==
type: Opaque
2 changes: 1 addition & 1 deletion .ibm/pipelines/env_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ KEYCLOAK_REALM='myrealm'
KEYCLOAK_CLIENT_ID='myclient'
KEYCLOAK_CLIENT_SECRET=$(cat /tmp/secrets/KEYCLOAK_CLIENT_SECRET)
ACR_SECRET=$(cat /tmp/secrets/ACR_SECRET)
DH_TARGET_URL=aHR0cDovL3Rlc3QtYmFja3N0YWdlLWN1c3RvbWl6YXRpb24tcHJvdmlkZXItc2hvd2Nhc2UtY2kucmhkaC1wci1vcy1hOTgwNTY1MDgzMGIyMmMzYWVlMjQzZTUxZDc5NTY1ZC0wMDAwLnVzLWVhc3QuY29udGFpbmVycy5hcHBkb21haW4uY2xvdWQ=
DH_TARGET_URL=dGVzdC1iYWNrc3RhZ2UtY3VzdG9taXphdGlvbi1wcm92aWRlci1zaG93Y2FzZS1jaS5yaGRoLXByLW9zLWE5ODA1NjUwODMwYjIyYzNhZWUyNDNlNTFkNzk1NjVkLTAwMDAudXMtZWFzdC5jb250YWluZXJzLmFwcGRvbWFpbi5jbG91ZA==
GOOGLE_CLIENT_ID=$(cat /tmp/secrets/GOOGLE_CLIENT_ID)
GOOGLE_CLIENT_SECRET=$(cat /tmp/secrets/GOOGLE_CLIENT_SECRET)
GOOGLE_ACC_COOKIE=$(cat /tmp/secrets/GOOGLE_ACC_COOKIE)
Expand Down
4 changes: 3 additions & 1 deletion .ibm/pipelines/openshift-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ apply_yaml_files() {
GITHUB_APP_CLIENT_SECRET=$(cat /tmp/secrets/GITHUB_APP_4_CLIENT_SECRET)
fi

for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN; do
DH_TARGET_URL=$(echo -n "test-backstage-customization-provider-${project}.${K8S_CLUSTER_ROUTER_BASE}" | base64 -w 0)

for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN DH_TARGET_URL; do
sed -i "s|${key}:.*|${key}: ${!key}|g" "$dir/auth/secrets-rhdh-secrets.yaml"
done

Expand Down
12 changes: 6 additions & 6 deletions .ibm/pipelines/resources/config_map/app-config-rhdh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ dynamicPlugins:
title: Dark Dynamic
variant: dark
backend:
reading:
allow:
- host: 'github.com'
- host: ${DH_TARGET_URL}
auth:
keys:
- secret: temp
Expand Down Expand Up @@ -101,17 +105,13 @@ auth:
development:
clientId: ${GOOGLE_CLIENT_ID}
clientSecret: ${GOOGLE_CLIENT_SECRET}
techRadar:
url: "http://${DH_TARGET_URL}/tech-radar"
proxy:
skipInvalidProxies: true
# endpoints: {}
endpoints:
# Other Proxies
# customize developer hub instance
'/developer-hub':
target: ${DH_TARGET_URL}
changeOrigin: true
# Change to "false" in case of using self hosted cluster with a self-signed certificate
secure: false
'/acr/api':
target: 'https://rhdhqetest.azurecr.io/acr/v1/'
changeOrigin: true
Expand Down
4 changes: 2 additions & 2 deletions .ibm/pipelines/value_files/values_showcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ global:
disabled: false
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import
disabled: false
# Enable tech-radar plugin.
# Enable tech-radar plugins.
- package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar
disabled: false
- package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar-backend-dynamic
disabled: true
disabled: false
- package: ./dynamic-plugins/dist/backstage-community-plugin-acr
disabled: false
- package: ./dynamic-plugins/dist/roadiehq-scaffolder-backend-module-http-request-dynamic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ test.describe("dynamic-plugins-info UI tests", () => {
await uiHelper.verifyRowsInTable(["backstage-plugin-techdocs"], true);
});

test.skip("it should have a backstage-plugin-tech-radar plugin which is Enabled and Preinstalled", async ({
test("it should have a plugin-tech-radar plugin which is Enabled and Preinstalled", async ({
page,
}) => {
await page
.getByPlaceholder("Filter")
.pressSequentially("backstage-plugin-tech-radar\n", { delay: 300 });
.pressSequentially("plugin-tech-radar\n", { delay: 300 });
const row = await page.locator(
UI_HELPER_ELEMENTS.rowByText("backstage-plugin-tech-radar"),
UI_HELPER_ELEMENTS.rowByText("backstage-community-plugin-tech-radar"),
);
expect(await row.locator("td").nth(2).innerText()).toBe("Yes"); // enabled
expect(await row.locator("td").nth(3).innerText()).toBe("Yes"); // preinstalled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Common } from "../../utils/common";
import { UIhelper } from "../../utils/ui-helper";
import { TechRadar } from "../../support/pages/tech-radar";

// Pre-req: Enable backstage-plugin-tech-radar and backstage-plugin-tech-radar-backend Plugin
// Pre-req: Enable plugin-tech-radar and plugin-tech-radar-backend Plugin

test.describe.skip("Test Customized Quick Access and tech-radar plugin", () => {
test.describe("Test Customized Quick Access and tech-radar plugin", () => {
test.beforeEach(async ({ page }) => {
const common = new Common(page);
await common.loginAsGuest();
Expand Down

0 comments on commit 4f7d6c4

Please sign in to comment.