Skip to content

Commit

Permalink
ci/ui: use os_to_test in UI manual workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
juadk committed Oct 4, 2024
1 parent 332c085 commit 7bb228f
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cli-obs-manual-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
destroy_runner: ${{ inputs.destroy_runner }}
k8s_downstream_version: ${{ inputs.k8s_downstream_version }}
k8s_upstream_version: ${{ inputs.k8s_upstream_version }}
operator_install_type: ui
operator_repo: ${{ inputs.operator_repo }}
os_to_test: ${{ inputs.os_to_test }}
qase_run_id: ${{ inputs.qase_run_id }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sub_ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ jobs:
K8S_UPSTREAM_VERSION: ${{ inputs.k8s_upstream_version }}
OPERATOR_REPO: ${{ inputs.operator_repo }}
OS_VERSION_INSTALL: ${{ inputs.os_version_install }}
OS_VERSION_TO_TEST: ${{ inputs.os_to_test }}
RANCHER_CHANNEL: ${{ inputs.rancher_version }}
RANCHER_GIT_CHART: ${{ inputs.rancher_git_chart }}
RANCHER_VERSION: ${{ steps.component.outputs.rancher_image_version }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ui-obs-manual-upgrade-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
elemental_ui_version: ${{ inputs.elemental_ui_version }}
k8s_downstream_version: ${{ inputs.k8s_downstream_version }}
k8s_upstream_version: ${{ inputs.k8s_upstream_version }}
operator_install_type: ui
proxy: ${{ inputs.proxy }}
qase_run_id: ${{ inputs.qase_run_id }}
rancher_version: ${{ inputs.rancher_version }}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/ui-obs-manual-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ on:
description: Elemental operator repository to use
default: oci://registry.opensuse.org/isv/rancher/elemental/dev/charts/rancher
type: string
os_to_test:
description: OS repository to test (dev/staging/stable)
type: string
default: dev
proxy:
description: Deploy a proxy (none/rancher/elemental)
default: elemental
type: string
qase_run_id:
description: Qase run ID where the results will be reported
type: string
rancher_version:
description: Rancher Manager channel/version/head_version to use for installation
default: stable/latest
Expand All @@ -57,8 +58,10 @@ jobs:
elemental_ui_version: ${{ inputs.elemental_ui_version }}
k8s_downstream_version: ${{ inputs.k8s_downstream_version }}
k8s_upstream_version: ${{ inputs.k8s_upstream_version }}
operator_install_type: ui
operator_repo: ${{ inputs.operator_repo }}
os_to_test: ${{ inputs.os_to_test }}
proxy: ${{ inputs.proxy }}
qase_run_id: ${{ inputs.qase_run_id }}
qase_run_id: auto
rancher_version: ${{ inputs.rancher_version }}
test_type: ui
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ e2e-install-backup-restore: deps
ginkgo --label-filter install-backup-restore -r -v ./e2e

e2e-install-chartmuseum:
sudo ./scripts/deploy-chartmuseum $(OPERATOR_REPO) $(OS_TO_TEST)
sudo ./scripts/deploy-chartmuseum $(OPERATOR_REPO)

e2e-install-rancher: deps
ginkgo --label-filter install -r -v ./e2e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import * as cypressLib from '@rancher-ecp-qa/cypress-library';
import { qase } from 'cypress-qase-reporter/dist/mocha';
import { isCypressTag, isGitRepo, isOperatorInstallType, isOperatorVersion, isRancherManagerVersion } from '~/support/utils';
import { Elemental } from '~/support/elemental';
import { isOsVersion } from '../../support/utils';

Check failure on line 21 in tests/cypress/latest/e2e/unit_tests/elemental_operator.spec.ts

View workflow job for this annotation

GitHub Actions / cypress-lint

'isOsVersion' is defined but never used

filterTests(['main', 'upgrade'], () => {
describe('Install Elemental Operator', () => {
Expand Down
7 changes: 6 additions & 1 deletion tests/cypress/latest/e2e/unit_tests/elemental_plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ limitations under the License.

import '~/support/commands';
import filterTests from '~/support/filterTests.js';
import { isRancherManagerVersion, isUIVersion } from '../../support/utils';
import { isRancherManagerVersion, isUIVersion , isOsVersion, isOperatorVersion} from '../../support/utils';
import * as cypressLib from '@rancher-ecp-qa/cypress-library';
import { qase } from 'cypress-qase-reporter/dist/mocha';

Expand Down Expand Up @@ -72,5 +72,10 @@ filterTests(['main', 'upgrade'], () => {
.and('contain', 'Uninstall');
})
);
it('Add additional channel', () => {
if ( isOsVersion('stable') && isOperatorVersion('dev') || isOperatorVersion('staging')) {
cypressLib.accesMenu('OS Management');
cy.addOsVersionChannel('stable');
}});
});
});
1 change: 1 addition & 0 deletions tests/cypress/latest/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions)
config.env.operator_repo = process.env.OPERATOR_REPO;
config.env.os_version_install = process.env.OS_VERSION_INSTALL;
config.env.os_version_target = process.env.OS_VERSION_TARGET;
config.env.os_version_to_test = process.env.OS_VERSION_TO_TEST;
config.env.password = process.env.RANCHER_PASSWORD;
config.env.proxy_ip = process.env.PROXY_IP;
config.env.proxy = process.env.PROXY;
Expand Down
4 changes: 3 additions & 1 deletion tests/cypress/latest/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ Cypress.Commands.add('createMachReg', (
}
} else if (utils.isOperatorVersion('registry.suse.com') || utils.isOperatorVersion('marketplace')) {
cy.contains(Cypress.env('os_version_install')).click();
} else if ( utils.isOsVersion('stable') && utils.isOperatorVersion('dev') || utils.isOperatorVersion('staging')) {
cy.contains(Cypress.env('iso_stable_os_version')).click();
} else {
cy.contains('(unstable)').click();
}
Expand Down Expand Up @@ -367,7 +369,7 @@ Cypress.Commands.add('addOsVersionChannel', (channelVersion: string) => {

switch (channelVersion) {
case "stable":
channelRepo = 'registry.suse.com/rancher/elemental-channel:latest';
channelRepo = 'registry.suse.com/rancher/elemental-channel/sl-micro:6.0-baremetal';
break;
case "dev":
channelRepo = 'registry.opensuse.org/isv/rancher/elemental/dev/containers/rancher/elemental-unstable-channel:latest';
Expand Down
5 changes: 5 additions & 0 deletions tests/cypress/latest/support/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export const isOperatorVersion = (version: string) => {
return (new RegExp(version)).test(Cypress.env("operator_repo"));
}

// Check OS version to test
export const isOsVersion = (version: string) => {
return (new RegExp(version)).test(Cypress.env("os_version_to_test"));
}

// Check rancher manager version
export const isRancherManagerVersion = (version: string) => {
return (new RegExp(version)).test(Cypress.env("rancher_version"));
Expand Down
4 changes: 1 addition & 3 deletions tests/scripts/deploy-chartmuseum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ PATH+=:/usr/local/bin

# Variables
typeset REPO=$1
shift
typeset -l OS2TEST=$1

# Create a systemctl file for chartmuseum
cat > /etc/systemd/system/chartmuseum.service << EOF
Expand Down Expand Up @@ -47,7 +45,7 @@ helm plugin install https://github.com/chartmuseum/helm-push.git
helm repo add chartmuseum http://localhost:8080

# Check if we want to use Development version of Elemental
[[ "${OS2TEST}" =~ (dev|staging) ]] && DEVEL="--devel"
[[ "${REPO}" =~ (dev|staging) ]] && DEVEL="--devel"

# Download needed helm charts
helm pull ${DEVEL} ${REPO}/elemental-operator-crds-chart
Expand Down
1 change: 1 addition & 0 deletions tests/scripts/start-cypress-tests
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ docker run -v $PWD:/workdir -w /workdir \
-e OPERATOR_REPO=$OPERATOR_REPO \
-e OS_VERSION_INSTALL=$OS_VERSION_INSTALL \
-e OS_VERSION_TARGET=$OS_VERSION_TARGET \
-e OS_VERSION_TO_TEST=$OS_VERSION_TO_TEST \
-e PROXY=$PROXY \
-e QASE_API_TOKEN=$QASE_API_TOKEN \
-e QASE_REPORT=$QASE_REPORT \
Expand Down

0 comments on commit 7bb228f

Please sign in to comment.