Skip to content

Commit

Permalink
chore: Merge kyma tests into integration (#3388)
Browse files Browse the repository at this point in the history
* wip

* wip

* wip

* fix setup kyma

* use proper target

* fix smoke tests

* fix smoke

* fix package.json

* fix hpa test

* fix module test

* remove leftovers

* update package.json

* remove unused tests
  • Loading branch information
dbadura authored Oct 14, 2024
1 parent 13ebe0d commit 11e7218
Show file tree
Hide file tree
Showing 58 changed files with 52 additions and 4,611 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/setup-kyma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ kubectl apply -f https://github.com/kyma-project/telemetry-manager/releases/late
kubectl apply -f https://github.com/kyma-project/telemetry-manager/releases/latest/download/telemetry-default-cr.yaml -n kyma-system

echo "Apply modules fixtures"
kubectl apply -f tests/kyma/fixtures/modules
kubectl apply -f tests/integration/fixtures/modules

echo "Apply gardener resources"
echo "Certificates"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pull-kyma-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
paths:
- ".github/workflows/pull-kyma-intergation-tests.yml"
- "resources/**"
- "tests/kyma/**"
- "tests/integration/**"
- "nginx/**"
- "src/**"
- "kyma/**"
Expand Down Expand Up @@ -40,11 +40,11 @@ jobs:
- name: run_tests
shell: bash
run: |
k3d kubeconfig get kyma > tests/kyma/fixtures/kubeconfig.yaml
k3d kubeconfig get kyma > tests/integration/fixtures/kubeconfig.yaml
export CYPRESS_DOMAIN=http://localhost:3001
cd tests/kyma
npm ci && npm run "test:e2e"
cd tests/integration
npm ci && npm run "test:kyma-e2e"
- name: Uploads artifacts
uses: actions/upload-artifact@v4
if: ${{ always() }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-smoke-test-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
- name: run_tests
shell: bash
run: |
k3d kubeconfig get kyma > tests/kyma/fixtures/kubeconfig.yaml
k3d kubeconfig get kyma > tests/integration/fixtures/kubeconfig.yaml
export CYPRESS_DOMAIN=http://localhost:3001
cd tests/kyma
cd tests/integration
npm ci && npm run "test:smoke-extensions"
- name: Uploads artifacts
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-smoke-test-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
- name: run_tests
shell: bash
run: |
k3d kubeconfig get kyma > tests/kyma/fixtures/kubeconfig.yaml
k3d kubeconfig get kyma > tests/integration/fixtures/kubeconfig.yaml
export CYPRESS_DOMAIN=http://localhost:3001
cd tests/kyma
cd tests/integration
npm ci && npm run "test:smoke-extensions"
- name: Uploads artifacts
uses: actions/upload-artifact@v4
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ module.exports = defineConfig({
return require('./plugins')(on, config);
},
specPattern: [
'tests/cluster/test-check-extensions.spec.js',
'tests/namespace/a-run-before.spec.js',
'tests/namespace/test-smoke-service-management.spec.js',
'tests/namespace/test-check-extensions.spec.js',
'tests/namespace/z-run-after.spec.js',
'tests/kyma-cluster/test-check-extensions.spec.js',
'tests/kyma-namespace/a-run-before.spec.js',
'tests/kyma-namespace/test-smoke-service-management.spec.js',
'tests/kyma-namespace/test-check-extensions.spec.js',
'tests/kyma-namespace/z-run-after.spec.js',
],
supportFile: 'support/index.js',
},
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = defineConfig({
viewportHeight: 1500,
scrollBehavior: false,
video: true,
watchForFileChanges: false,
screenshotsFolder: process?.env?.ARTIFACTS
? `${process.env?.ARTIFACTS}/screenshots`
: 'cypress/screenshots',
Expand Down Expand Up @@ -78,6 +79,16 @@ module.exports = defineConfig({
'tests/namespace/test-limit-ranges.spec.js',
'tests/namespace/test-resource-quotas.spec.js',
'tests/namespace/z-run-after.spec.js',
'tests/kyma-cluster/test-kyma-modules.spec.js',
'tests/kyma-namespace/a-run-before.spec.js',
'tests/kyma-namespace/test-certificates.spec.js',
'tests/kyma-namespace/test-issuers.spec.js',
'tests/kyma-namespace/test-dns-providers.spec.js',
'tests/kyma-namespace/test-hpa.spec.js',
'tests/kyma-namespace/test-oauth2.spec.js',
'tests/kyma-namespace/test-dns-entries.spec.js',
'tests/kyma-namespace/test-services.spec.js',
'tests/kyma-namespace/z-run-after.spec.js',
],
supportFile: 'support/index.js',
},
Expand Down
7 changes: 6 additions & 1 deletion tests/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
"start": "cypress open",
"start:local": "CYPRESS_LOCAL_DEV=true cypress open",
"test:cluster": "cypress run --spec \"tests/cluster/*.spec.js,tests/extensibility/*.spec.js\" --browser chromium",
"test:namespace": "cypress run --spec \"tests/namespace/*.spec.js\" --browser chromium",
"test:cluster:local": "CYPRESS_LOCAL_DEV=true cypress run --spec \"tests/cluster/*.spec.js,tests/extensibility/*.spec.js\" --browser chrome",
"test:namespace": "cypress run --spec \"tests/namespace/*.spec.js\" --browser chromium",
"test:namespace:local": "CYPRESS_LOCAL_DEV=true cypress run --spec \"tests/namespace/*.spec.js\" --browser chrome",
"test:accesibility": "cypress run --spec \"tests/accessibility/*.spec.js\" --browser chromium",
"test:kyma-e2e": "cypress run --spec \"tests/kyma*/*spec.js\" --browser chromium",
"test:kyma-e2e:local": "CYPRESS_LOCAL_DEV=true cypress run --spec \"tests/kyma*/*spec.js\" --browser chromium",
"test:smoke-extensions": "cypress run --browser chromium -C cypress-smoke.js",
"test:local": "CYPRESS_LOCAL_DEV=true cypress run --browser chrome",
"run-docker": "docker run --rm -it -p 3001:3001 -e DOCKER_DESKTOP_CLUSTER=true --net=host --pid=host --name kyma-dashboard --env ENVIRONMENT=$ENV europe-docker.pkg.dev/kyma-project/dev/busola-kyma-web-local:PR-$PR_NUMBER",
"test:accesibility": "cypress run --spec \"tests/accessibility/*.spec.js\" --browser chromium",
"test:accesibility:local": "CYPRESS_LOCAL_DEV=true cypress run --spec \"tests/accessibility/*.spec.js\" --browser chrome"
},
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/integration/support/create-edit-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Cypress.Commands.add('checkUnsavedDialog', () => {

cy.get('ui5-dialog[header-text="Discard Changes"]').should('be.visible');

cy.get('ui5-dialog[header-text="Discard Changes"]')
cy.get('ui5-dialog[header-text="Discard Changes"]:visible')
.find('ui5-button')
.contains('Cancel')
.click();
Expand Down
1 change: 1 addition & 0 deletions tests/integration/support/exceptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Cypress.Commands.add('handleExceptions', () => {
"Cannot read properties of undefined (reading 'uri')",
) ||
err.message.includes('ResizeObserver loop limit exceeded') ||
err.message.includes('502 Bad Gateway') ||
err.message.includes(
'ResizeObserver loop completed with undelivered notifications',
) ||
Expand Down
14 changes: 14 additions & 0 deletions tests/integration/support/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,17 @@ export function chooseComboboxOption(selector, optionText) {

return cy.end();
}

export function useCategory(category) {
before(() => {
cy.getLeftNav()
.contains(category)
.click();
});

after(() => {
cy.getLeftNav()
.contains(category)
.click();
});
}
4 changes: 4 additions & 0 deletions tests/integration/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ import './createNamespace';
import './loadFile';
import './mockConfig';
import '../continuum/cypress';
import './check-extension';
import './navigate-back-to';
import './helpers';

require('cypress-plugin-tab');
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ context('Test HPA', () => {
});

it('Create HPA', () => {
cy.navigateTo('Discovery and Network', 'Horizontal Pod');
cy.navigateTo('Discovery and Network', 'Horizontal Pod Autoscalers');

cy.openCreate();

Expand Down
8 changes: 0 additions & 8 deletions tests/kyma/config.js

This file was deleted.

51 changes: 0 additions & 51 deletions tests/kyma/cypress.config.js

This file was deleted.

Loading

0 comments on commit 11e7218

Please sign in to comment.