Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .openshift-ci/dispatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ case "$ci_job" in
esac

case "$ci_job" in
eks-qa-e2e-tests|osd*qa-e2e-tests|ocp*e2e-tests)
eks-qa-e2e-tests|osd*qa-e2e-tests)
setup_automation_flavor_e2e_cluster "$ci_job"
;;
esac
Expand Down
18 changes: 5 additions & 13 deletions tests/e2e/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1480,20 +1480,12 @@ setup_automation_flavor_e2e_cluster() {
ls -l "${SHARED_DIR}"
export KUBECONFIG="${SHARED_DIR}/kubeconfig"

if [[ "$ci_job" =~ ^(osd|ocp) ]]; then
info "Logging in to an ${ci_job:0:3} cluster"
if [[ "$ci_job" =~ ^osd ]]; then
info "Logging in to an OSD cluster"
source "${SHARED_DIR}/dotenv"

# OCP and OSD require one of (OPENSHIFT_CONSOLE_|CLUSTER_) var groups.
# Fail if neither are found from the dotenv.
export OPENSHIFT_CONSOLE_URL="${OPENSHIFT_CONSOLE_URL:-${CLUSTER_CONSOLE_ENDPOINT:-$(oc whoami --show-console)}}"
export OPENSHIFT_API_ENDPOINT="${OPENSHIFT_API_ENDPOINT:-${CLUSTER_API_ENDPOINT:-$(oc whoami --show-server)}}"
export OPENSHIFT_CONSOLE_USERNAME="${OPENSHIFT_CONSOLE_USERNAME:-${CLUSTER_USERNAME:-kubeadmin}}"
export OPENSHIFT_CONSOLE_PASSWORD="${OPENSHIFT_CONSOLE_PASSWORD:-${CLUSTER_PASSWORD}}"

oc login "$OPENSHIFT_API_ENDPOINT" \
--username "$OPENSHIFT_CONSOLE_USERNAME" \
--password "$OPENSHIFT_CONSOLE_PASSWORD" \
oc login "$CLUSTER_API_ENDPOINT" \
--username "$CLUSTER_USERNAME" \
--password "$CLUSTER_PASSWORD" \
--insecure-skip-tls-verify=true
fi
}
Expand Down
2 changes: 0 additions & 2 deletions ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ test-component: deps $(SOURCES)
test-e2e: deps $(SOURCES)
@echo "+ $@"
npm run test-e2e
# Uncomment this once the plugin is installed via the operator in CI
# npm run test-e2e:ocp

.PHONY: clean
clean:
Expand Down
30 changes: 0 additions & 30 deletions ui/apps/platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,36 +142,6 @@ run all end-to-end tests in a headless mode use `npm run test-e2e-local`. To run
one test suite specifically in headless mode, use
`npm run cypress-spec <spec-file>`.

#### End-to-end Tests (Cypress targeting console plugin)

To run Cypress against the OCP console for dynamic plugin tests, there are two scenarios that are supported.

1. Running against a locally deployed version of the development console with bridge authentication off

```sh
# If necessary, export the target URL
export OPENSHIFT_CONSOLE_URL=<url-to-web-console-ui>
# Set ORCHESTRATOR_FLAVOR, which is typically only available in CI
export ORCHESTRATOR_FLAVOR='openshift'
# Runs Cypress OCP tests ignoring authentication
OCP_BRIDGE_AUTH_DISABLED=true npm run cypress-open:ocp
```

2. Running against a deployed version of the console with username/password credentials

```sh
# If necessary, export the target URL
export OPENSHIFT_CONSOLE_URL=<url-to-web-console-ui>
# Set ORCHESTRATOR_FLAVOR, which is typically only available in CI
export ORCHESTRATOR_FLAVOR='openshift'
# export credentials
export OPENSHIFT_CONSOLE_USERNAME='kubeadmin'
export OPENSHIFT_CONSOLE_PASSWORD=<password>

# Runs Cypress OCP tests with a session initialization step
npm run cypress-open:ocp
```

### Feature flags

#### Add a feature flag to frontend code
Expand Down
2 changes: 2 additions & 0 deletions ui/apps/platform/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

module.exports = {
blockHosts: ['*.*'], // Browser options
chromeWebSecurity: false, // Browser options
defaultCommandTimeout: 8000, // Timeouts options
numTestsKeptInMemory: 0, // Global options
Expand All @@ -24,6 +25,7 @@ module.exports = {

e2e: {
baseUrl: 'https://localhost:3000',
specPattern: 'cypress/integration/**/*.test.{js,ts}',
viewportHeight: 850, // Viewport options
viewportWidth: 1440, // Viewport options
setupNodeEvents: (on) => {
Expand Down
21 changes: 0 additions & 21 deletions ui/apps/platform/cypress/helpers/ocpAuth.ts

This file was deleted.

11 changes: 0 additions & 11 deletions ui/apps/platform/cypress/integration-ocp/smoke.test.ts

This file was deleted.

3 changes: 0 additions & 3 deletions ui/apps/platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,10 @@
"lint:fix": "eslint --fix --quiet",
"tsc": "tsc",
"cypress-open": "./scripts/cypress.sh open --e2e --config defaultBrowser=chrome",
"cypress-open:ocp": "./scripts/cypress-ocp.sh open --e2e --config defaultBrowser=chrome",
"cypress-spec": "./scripts/cypress.sh run --spec",
"cypress-component": "CYPRESS_COMPONENT_TEST=true ./scripts/cypress-component.sh open --component",
"test-e2e": "TZ=UTC ./scripts/cypress.sh run --reporter mocha-multi-reporters --reporter-options configFile=cypress/mocha.config.js",
"test-e2e-local": "TZ=UTC ./scripts/cypress.sh run",
"test-e2e:ocp": "TZ=UTC ./scripts/cypress-ocp.sh run --reporter mocha-multi-reporters --reporter-options configFile=cypress/mocha.config.js",
"test-e2e-local:ocp": "TZ=UTC ./scripts/cypress-ocp.sh run",
"test-component": "TZ=UTC CYPRESS_COMPONENT_TEST=true ./scripts/cypress-component.sh run --reporter mocha-multi-reporters --reporter-options configFile=cypress/mocha.config.js --component",
"generate-graphql-possible-types": "ROX_AUTH_TOKEN=$(./scripts/get-auth-token.sh) node scripts/generate-graphql-possible-types.js",
"postinstall": "node scripts/check-optional-dependency-versions.js"
Expand Down
56 changes: 0 additions & 56 deletions ui/apps/platform/scripts/cypress-ocp.sh

This file was deleted.

12 changes: 5 additions & 7 deletions ui/apps/platform/scripts/cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ curl_cfg() { # Use built-in echo to not expose $2 in the process list.
}

if [[ -n "$ROX_ADMIN_PASSWORD" ]]; then
readarray -t arr < <(curl -sk --config <(curl_cfg user "admin:$ROX_ADMIN_PASSWORD") "${api_endpoint}"/v1/featureflags | jq -cr '.featureFlags[] | {name: .envVar, enabled: .enabled}')
readarray -t arr < <(curl -sk --config <(curl_cfg user "admin:$ROX_ADMIN_PASSWORD") ${api_endpoint}/v1/featureflags | jq -cr '.featureFlags[] | {name: .envVar, enabled: .enabled}')
for i in "${arr[@]}"; do
name=$(echo "$i" | jq -rc .name)
val=$(echo "$i" | jq -rc .enabled)
export CYPRESS_"${name}"="${val}"
name=$(echo $i | jq -rc .name)
val=$(echo $i | jq -rc .enabled)
export CYPRESS_${name}=${val}
done
fi
export CYPRESS_ROX_AUTH_TOKEN=$(./scripts/get-auth-token.sh)
Expand All @@ -31,12 +31,10 @@ if [[ -n "${UI_BASE_URL}" ]]; then
export CYPRESS_BASE_URL="${UI_BASE_URL}"
fi

export CYPRESS_SPEC_PATTERN='cypress/integration/**/*.test.{js,ts}'

# be able to skip tests that are not relevant, for example: openshift
export CYPRESS_ORCHESTRATOR_FLAVOR="${ORCHESTRATOR_FLAVOR}"

if [ "$2" == "--spec" ]; then
if [ $2 == "--spec" ]; then
if [ $# -ne 3 ]; then
echo "usage: npm run cypress-spec <spec-file>"
exit 1
Expand Down
1 change: 0 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"lint": "npm --prefix apps/platform run lint",
"test": "CI=true npm --prefix apps/platform run test",
"test-e2e": "TEST_RESULTS_OUTPUT_DIR=../../test-results npm --prefix apps/platform run test-e2e",
"test-e2e:ocp": "TEST_RESULTS_OUTPUT_DIR=../../test-results npm --prefix apps/platform run test-e2e:ocp",
"test-component": "npm --prefix apps/platform run test-component",
"posttest-e2e:coverage": "mv apps/platform/coverage/ ./test-results/artifacts/",
"prebuild": "npm run clean",
Expand Down
Loading