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

Support prerelease helm version and custom chart version #97

Merged
merged 3 commits into from
Jan 13, 2025
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
5 changes: 5 additions & 0 deletions .github/workflows/master-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ on:
required: true
type: string
default: '@install @short @full'
turtles_operator_version:
description: Turtles Operator Version; only to be used when nightly chart is set to false; default - latest stable version
type: string

jobs:
create-runner:
Expand Down Expand Up @@ -328,6 +331,7 @@ jobs:
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }}
QASE_RUN_ID: ${{ needs.pre-qase.outputs.qase_run_id }}
GREPTAGS: ${{ inputs.grep_test_by_tag }}
TURTLES_OPERATOR_VERSION: ${{inputs.turtles_operator_version}}
SPEC: |
e2e/unit_tests/first_connection.spec.ts
e2e/unit_tests/user.spec.ts
Expand Down Expand Up @@ -386,6 +390,7 @@ jobs:
if ${{ inputs.ui_account != '' }}; then
echo "UI User: ${{ inputs.ui_account }}" >> ${GITHUB_STEP_SUMMARY}
fi
echo "Rancher Turtles Operator Version: ${{ inputs.turtles_operator_version }}" >> ${GITHUB_STEP_SUMMARY}
echo "### Kubernetes" >> ${GITHUB_STEP_SUMMARY}
echo "K3s on Rancher Manager: ${{ env.INSTALL_K3S_VERSION }}" >> ${GITHUB_STEP_SUMMARY}

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ui-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
description: Rancher Manager channel/version/head_version to use for installation
default: latest/devel/2.10
type: string
turtles_operator_version:
description: Rancher Turtles operator version to test
type: string
grep_test_by_tag:
description: Grep tags. For multiple selection separate with spaces. Keep always @install
required: true
Expand Down Expand Up @@ -53,4 +56,5 @@ jobs:
qase_run_id: ${{ inputs.qase_run_id || 'auto' }}
grep_test_by_tag: ${{ inputs.grep_test_by_tag || '@install @short' }}
operator_nightly_chart: ${{ inputs.operator_nightly_chart == true || (github.event_name == 'schedule' && true) }}
turtles_operator_version: ${{ inputs.turtles_operator_version }}

25 changes: 24 additions & 1 deletion tests/cypress/latest/e2e/unit_tests/turtles_operator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ describe('Install Turtles Operator', { tags: '@install' }, () => {
cypressLib.burgerMenuToggle();
});

it("Change helm charts to Include Prerelease Versions", () => {
// this test should be run before the turtles repository is added; so that it can fetch the prereleased versions

// toggle the navigation menu to a close
cypressLib.burgerMenuToggle();

cy.getBySel('nav_header_showUserMenu').click();
cy.contains('Preferences').click();
cy.contains("Include Prerelease Versions").click();
cy.reload();
// check that the prerelease version is selected by ensuring it does not have `bg-disabled` class
cy.contains("Include Prerelease Versions").should('not.have.class', 'bg-disabled');
})

it('Add turtles repo', { retries: 2 }, () => {
var turtlesHelmRepo = Cypress.env('chartmuseum_repo')
// if the env var is empty or not defined at all; use the normal repo
Expand All @@ -45,7 +59,16 @@ describe('Install Turtles Operator', { tags: '@install' }, () => {
const questions = [
{ menuEntry: 'Rancher Turtles Features Settings', checkbox: 'Seamless integration with Fleet and CAPI' }
];
cy.installApp('Rancher Turtles', 'rancher-turtles-system', questions);

var turtlesVersion = Cypress.env('turtles_operator_version')

// if operator nightly chart is to be used, ignore the turtles version
var turtlesHelmRepo = Cypress.env('chartmuseum_repo')
if (turtlesHelmRepo != "" && turtlesHelmRepo != undefined) {
turtlesVersion = ""
}

cy.installApp('Rancher Turtles', turtlesVersion, 'rancher-turtles-system', questions);
})
);

Expand Down
1 change: 1 addition & 0 deletions tests/cypress/latest/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions)
config.baseUrl = url.replace(/\/$/,);
config.env.cache_session = process.env.CACHE_SESSION || false;
config.env.chartmuseum_repo = process.env.CHARTMUSEUM_REPO;
config.env.turtles_operator_version = process.env.TURTLES_OPERATOR_VERSION;
config.env.cluster = process.env.CLUSTER_NAME;
config.env.capi_ui_version = process.env.CAPI_UI_VERSION;
config.env.k8s_version = process.env.K8S_VERSION_TO_PROVISION;
Expand Down
7 changes: 6 additions & 1 deletion tests/cypress/latest/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,16 @@ Cypress.Commands.add('addCloudCredsAzure', (name: string, clientID: string, clie
// You can optionally provide an array of questions and answer them before the installation starts
// Example1: cy.installApp('Alerting', 'default', [{ menuEntry: '(None)', checkbox: 'Enable Microsoft Teams' }]);
// Example2: cy.installApp('Rancher Turtles', 'rancher-turtles-system', [{ menuEntry: 'Rancher Turtles Features Settings', checkbox: 'Seamless integration with Fleet and CAPI'},{ menuEntry: 'Rancher webhook cleanup settings', inputBoxTitle: 'Webhook Cleanup Image', inputBoxValue: 'registry.k8s.io/kubernetes/kubectl:v1.28.0'}]);
Cypress.Commands.add('installApp', (appName, namespace, questions) => {
Cypress.Commands.add('installApp', (appName, version, namespace, questions) => {
cy.get('.nav').contains('Apps').click();
cy.contains('Featured Charts').should('be.visible');
cy.contains(appName, { timeout: 60000 }).click();
cy.contains('Charts: ' + appName);

if (version != undefined && version != "") {
cy.contains(version).click();
cy.url().should("contain", version)
}
cy.clickButton('Install');
cy.contains('.outer-container > .header', appName);
cy.clickButton('Next');
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/latest/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare global {
forceUpdateFleetGitRepo(repoName: string, workspace?: string): Chainable<Element>;
checkFleetGitRepo(repoName: string, workspace?: string): Chainable<Element>;
accesMenuSelection(firstAccessMenu: string, secondAccessMenu?: string): Chainable<Element>;
installApp(appName: string, namespace: string, questions?: any): Chainable<Element>;
installApp(appName: string, namespace: string, version: string, questions?: any): Chainable<Element>;
deleteCluster(clusterName: string): Chainable<Element>;
searchCluster(clusterName: string): Chainable<Element>;
createNamespace(namespace: string): Chainable<Element>;
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 @@ -21,6 +21,7 @@ docker run -v $PWD:/workdir -w /workdir \
-e CYPRESS_TAGS=$CYPRESS_TAGS \
-e CAPI_UI_VERSION=$CAPI_UI_VERSION \
-e CHARTMUSEUM_REPO=$CHARTMUSEUM_REPO \
-e TURTLES_OPERATOR_VERSION=$TURTLES_OPERATOR_VERSION \
-e K8S_UPSTREAM_VERSION=$K8S_UPSTREAM_VERSION \
-e OPERATOR_REPO=$OPERATOR_REPO \
-e RANCHER_VERSION=$RANCHER_VERSION \
Expand Down
Loading