Skip to content

Commit

Permalink
feat: gha cypress namespace tests (#2981)
Browse files Browse the repository at this point in the history
* feat: gha cypress workflow

* rename of the file

* adjust metrics and versions

* adjust version of k3d

* bump timeout for terminating status

* trigger

* change exist to visible

* revert exist

* fix: retries

* fix: retries

* paths
  • Loading branch information
mrCherry97 authored Jun 20, 2024
1 parent 9692560 commit 3a41c20
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/busola-local-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
paths:
- ".github/workflows/busola-local-build.yml"
- "backend/**"
- "public/**"
- "src/**"
Expand All @@ -15,6 +16,7 @@ on:
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/busola-local-build.yml"
- "backend/**"
- "public/**"
- "src/**"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# fragments shamelessly stolen from https://github.com/kyma-project/api-gateway/tree/main/.github
name: Cypress PoC
on: workflow_dispatch
name: pull-integration-namespace-k3d

on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/pull-integration-namespace-k3d.yml"
- "resources/**"
- "tests/**"
- "nginx/**"
- "src/**"
- "tests/**"

jobs:
test:
run-test:
runs-on: ubuntu-latest
# environment:
# name: release
steps:
- uses: gardenlinux/workflow-telemetry-action@6f19ac2411a52a120abb74c812592b44f165d05c # pin@v1
- uses: gardenlinux/workflow-telemetry-action@v2
with:
metric_frequency: 1
proc_trace_min_duration: 10
proc_trace_chart_max_count: 50
comment_on_pr: false
- uses: actions/checkout@v4
with:
# ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
Expand Down Expand Up @@ -54,14 +58,14 @@ jobs:
cd tests/integration
npm ci && npm run "test:namespace"
- name: Uploads artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: cypress-${{ github.job }}
path: tests/integration/cypress/
retention-days: 90
- name: Upload Busola logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: busola-logs-${{ github.job }}
Expand Down
21 changes: 15 additions & 6 deletions tests/integration/tests/namespace/z-run-after.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,24 @@ context('Clean up Namespace', () => {
checkIfResourceIsRemoved: false,
selectSearchResult: true,
});
});

it('Check if the Namespace is terminated (step 2)', { retries: 3 }, () => {
cy.get('ui5-table-row')
.find('.status-badge')
.contains('Terminating');

cy.get('ui5-table')
.contains(Cypress.env('NAMESPACE_NAME'))
.should('not.exist', { timeout: 50000 });
});

it(
'Check if the Namespace is terminated (step 2)',
{
retries: {
runMode: 3,
openMode: 3,
},
},
() => {
cy.get('ui5-table')
.contains(Cypress.env('NAMESPACE_NAME'))
.should('not.exist', { timeout: 50000 });
},
);
});

0 comments on commit 3a41c20

Please sign in to comment.