-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Chandan Pinjani <chandan.pinjani@suse.com>
- Loading branch information
Showing
6 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
# rancher-turtles-e2e | ||
|
||
What tests are doing: | ||
1. Create the infra stack ( GCP runner, cert-manager, rancher ) | ||
2. Install the Turtles operator with locally built nightly chart | ||
3. Deploy the Turtles UI extension | ||
4. Test the Turtles menu, namespaces import features | ||
5. Perform CAPD setup prerequisites | ||
6. Create & Import CAPD cluster using fleet | ||
7. Install App on imported cluster | ||
|
||
|
||
[![UI-RM_head_2.7](https://github.com/rancher-sandbox/rancher-turtles-e2e/actions/workflows/ui-rm_head_2.7.yaml/badge.svg?branch=main)](https://github.com/rancher-sandbox/rancher-turtles-e2e/actions/workflows/ui-rm_head_2.7.yaml) | ||
|
||
[![UI-RM_head_2.8](https://github.com/rancher-sandbox/rancher-turtles-e2e/actions/workflows/ui-rm_head_2.8.yaml/badge.svg?branch=main)](https://github.com/rancher-sandbox/rancher-turtles-e2e/actions/workflows/ui-rm_head_2.8.yaml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
Copyright © 2022 - 2023 SUSE LLC | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import '~/support/commands'; | ||
import * as cypressLib from '@rancher-ecp-qa/cypress-library'; | ||
import { qase } from 'cypress-qase-reporter/dist/mocha'; | ||
|
||
Cypress.config(); | ||
describe('Import CAPD', () => { | ||
const cluster = "cluster1-capi" | ||
const repo = "https://github.com/rancher-sandbox/rancher-turtles-fleet-example.git" | ||
|
||
beforeEach(() => { | ||
cy.login(); | ||
cy.visit('/'); | ||
cypressLib.burgerMenuToggle(); | ||
}); | ||
|
||
qase(14, | ||
it('Import CAPD cluster using fleet', () => { | ||
cypressLib.checkNavIcon('cluster-management') | ||
.should('exist'); | ||
|
||
// Click on the Continuous Delivery's icon | ||
cypressLib.accesMenu('Continuous Delivery'); | ||
cypressLib.accesMenu('Git Repos'); | ||
|
||
// Change fleet namespace | ||
cy.contains('fleet-default').click(); | ||
cy.contains('fleet-local').click(); | ||
|
||
// Add CAPD fleet repository | ||
cy.clickButton('Add Repository'); | ||
cy.typeValue('Name', 'clusters'); | ||
cy.typeValue('Repository URL', repo); | ||
cy.typeValue('Branch Name', 'main'); | ||
|
||
// Create Git repo | ||
cy.clickButton('Next'); | ||
cy.clickButton('Create'); | ||
cy.contains('clusters').click(); | ||
|
||
// Check cluster is created and auto-imported | ||
cypressLib.burgerMenuToggle(); | ||
cypressLib.checkClusterStatus(cluster, 'Pending', 120000); | ||
|
||
// Check cluster is Active | ||
cy.clickButton('Manage'); | ||
cy.contains('Active' + ' ' + cluster, {timeout: 120000}); | ||
}) | ||
); | ||
|
||
|
||
qase(15, | ||
it('Install App on imported cluster', () => { | ||
|
||
// Click on imported CAPD cluster | ||
cy.contains(cluster).click(); | ||
cy.get('.nav').contains('Apps') | ||
.click(); | ||
cy.contains('Monitoring', {timeout:30000}) | ||
.click(); | ||
cy.contains('Charts: Monitoring', {timeout:30000}); | ||
|
||
// Install monitoring app | ||
cy.clickButton('Install'); | ||
cy.contains('.outer-container > .header', 'Monitoring'); | ||
cy.clickButton('Next'); | ||
cy.clickButton('Install'); | ||
|
||
// Close the shell to avoid conflict | ||
cy.get('.closer', {timeout:20000}) | ||
.click(); | ||
cy.contains('Only User Namespaces') // eslint-disable-line cypress/unsafe-to-chain-command | ||
.click() | ||
.type('cattle-monitoring-system{enter}{esc}'); | ||
|
||
// Resource should be deployed (green badge) | ||
cy.get('.outlet').contains('Deployed rancher-monitoring', {timeout: 240000}); | ||
|
||
}) | ||
); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/* | ||
Copyright © 2022 - 2023 SUSE LLC | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import '~/support/commands'; | ||
import * as cypressLib from '@rancher-ecp-qa/cypress-library'; | ||
import { qase } from 'cypress-qase-reporter/dist/mocha'; | ||
|
||
Cypress.config(); | ||
describe('Enable CAPD provider', () => { | ||
const namespace = "capd-system" | ||
const deployment = "rancher-turtles-controller-manager" | ||
|
||
beforeEach(() => { | ||
cy.login(); | ||
cy.visit('/'); | ||
cypressLib.burgerMenuToggle(); | ||
}); | ||
|
||
qase(11, | ||
it('CAPD prerequisites', () => { | ||
|
||
// Open Rancher turtles deployment | ||
cy.contains('local') | ||
.click(); | ||
cy.get('.nav').contains('Workloads') | ||
.click(); | ||
cy.get('.nav').contains('Deployments') | ||
.click(); | ||
cy.contains('Only User Namespaces') // eslint-disable-line cypress/unsafe-to-chain-command | ||
.click() | ||
.type('rancher-turtles-system{enter}{esc}'); | ||
|
||
// Edit Rancher turtles deployment | ||
cy.getBySel('sortable-table-1-action-button').click(); | ||
cy.contains('Edit Config') | ||
.click(); | ||
cy.byLabel('Arguments').as('label') | ||
cy.get('@label').type(' --insecure-skip-verify=true') | ||
cy.clickButton('Save'); | ||
cy.contains('Active' + ' ' + deployment, {timeout: 20000}); | ||
cy.getBySel('namespaces-values-close-0') | ||
.click(); | ||
cy.contains('Only User Namespaces') | ||
.click(); | ||
}) | ||
); | ||
|
||
qase(12, | ||
it('Create CAPD namespace', () => { | ||
cy.contains('local') | ||
.click(); | ||
cypressLib.accesMenu('Projects/Namespaces'); | ||
cy.contains('Only User Namespaces') // eslint-disable-line cypress/unsafe-to-chain-command | ||
.click() | ||
.type('Not{enter}{esc}'); | ||
|
||
// Create CAPD namespace | ||
cy.contains('Create Namespace') | ||
.click(); | ||
cy.typeValue('Name', namespace); | ||
cy.clickButton('Create'); | ||
cy.contains('Active' + ' ' + namespace); | ||
|
||
cy.getBySel('namespaces-values').click(); | ||
cy.contains('Only User Namespaces') | ||
.click(); | ||
}) | ||
); | ||
|
||
qase(13, | ||
it('Create CAPD provider', () => { | ||
cypressLib.checkNavIcon('cluster-management') | ||
.should('exist'); | ||
cypressLib.accesMenu('Cluster Management'); | ||
|
||
// Open Turtles menu | ||
cypressLib.accesMenu('CAPI'); | ||
|
||
// Create CAPD Infrastructure provider | ||
cy.contains('.nav', "Infrastructure Providers").click(); | ||
cy.clickButton('Create from YAML') | ||
cy.readFile('./fixtures/capd-provider.yaml').then((data) => { | ||
cy.get('.CodeMirror') | ||
.then((editor) => { | ||
editor[0].CodeMirror.setValue(data); | ||
}) | ||
}) | ||
cy.clickButton('Create') | ||
cy.contains('Active ' + 'docker'); | ||
}) | ||
); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: operator.cluster.x-k8s.io/v1alpha1 | ||
kind: InfrastructureProvider | ||
metadata: | ||
name: docker | ||
namespace: capd-system | ||
spec: | ||
secretName: capi-env-variables | ||
secretNamespace: capi-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters