Skip to content

Commit

Permalink
Merge pull request #1792 from aziontech/dev
Browse files Browse the repository at this point in the history
Deploy 2024-10-07
  • Loading branch information
vinigfer authored Oct 7, 2024
2 parents a58e2d3 + 27de4e5 commit 26f6b88
Show file tree
Hide file tree
Showing 103 changed files with 1,625 additions and 371 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/cleanup_e2e_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run cleanup e2e tests

on:
schedule:
- cron: '0 8 * * *'
workflow_dispatch:

jobs:
cleanup:
name: Cleanup e2e tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Node.js Environment
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: yarn install

- name: Cleanup Prod
env:
PROD_CYPRESS_TOKEN: ${{ secrets.PROD_CYPRESS_TOKEN }}
run: node scripts/cleanup.js PROD
12 changes: 7 additions & 5 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
coverage/unit/sonar-report.xml
retention-days: 1

run-dev-e2e-tests:
run-prod-e2e-tests:
name: Run Dev E2E Tests
runs-on: ubuntu-latest
strategy:
Expand All @@ -61,15 +61,17 @@ jobs:
- name: Run Cypress Tests
uses: cypress-io/github-action@v6
env:
DEV_CYPRESS_EMAIL: ${{ secrets.DEV_CYPRESS_EMAIL }}
DEV_CYPRESS_PASSWORD: ${{ secrets.DEV_CYPRESS_PASSWORD }}
PROD_CYPRESS_EMAIL: ${{ secrets.PROD_CYPRESS_EMAIL }}
PROD_CYPRESS_PASSWORD: ${{ secrets.PROD_CYPRESS_PASSWORD }}
VITE_ENVIRONMENT: "production"
with:
build: yarn build
start: yarn dev --logLevel=warn
browser: chrome
wait-on: 'http://localhost:5173/'
wait-on-timeout: 120
env: grepTags=@dev${{ matrix.group }}+-@xfail
config-file: cypress.config.prod.js
env: environment=prod,grepTags=@dev${{ matrix.group }}+-@xfail+-@dont_run_prod

- name: Generate Specs JSON
run: yarn generate-specs-json
Expand Down Expand Up @@ -106,7 +108,7 @@ jobs:

download_and_merge:
name: Download and Merge Coverage Reports
needs: run-dev-e2e-tests
needs: run-prod-e2e-tests
runs-on: ubuntu-latest

steps:
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/prod-e2e-tests.yml

This file was deleted.

1 change: 0 additions & 1 deletion cypress.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import baseConfig from './cypress.config';

const envOverride = {
// TODO: remove this WORKAROUND for https://github.com/cypress-io/cypress/issues/20647,
baseUrl: 'http://console.azion.com',
CYPRESS_EMAIL: process.env.PROD_CYPRESS_EMAIL,
CYPRESS_PASSWORD: process.env.PROD_CYPRESS_PASSWORD,
};
Expand Down
6 changes: 5 additions & 1 deletion cypress.env.example.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"DEV_CYPRESS_EMAIL": "",
"DEV_CYPRESS_PASSWORD": "",
"DEV_CYPRESS_TOKEN": "",
"STAGE_CYPRESS_EMAIL": "",
"STAGE_CYPRESS_PASSWORD": "",
"STAGE_CYPRESS_TOKEN": "",
"PREVIEW_PROD_CYPRESS_EMAIL": "",
"PREVIEW_PROD_CYPRESS_PASSWORD": "",
"PREVIEW_PROD_CYPRESS_TOKEN": "",
"PROD_CYPRESS_EMAIL": "",
"PROD_CYPRESS_PASSWORD": ""
"PROD_CYPRESS_PASSWORD": "",
"PROD_CYPRESS_TOKEN": ""
}
9 changes: 5 additions & 4 deletions cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ For more details, see the official [@cypress/grep documentation](https://github.
### Tags Used in the Project
| Tag | Description |
|-------|-----------------------------------------------------|
| @dev | Runs the test in the DEV environment |
| @xfail| Prevents the test from running in workflows |
| Tag | Description |
|-----------------|-----------------------------------------------------|
| @dev | Runs the test in the DEV environment |
| @xfail | Prevents the test from running in workflows |
| @dont_run_prod | Prevents the test from running in prod workflow |
## Naming `data-testid`
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/domains/create-domain-edge-application.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const createEdgeApplicationCase = () => {
cy.get(selectors.domains.pageTitle(edgeAppName)).should('have.text', edgeAppName)
}

describe('Domains spec', { tags: ['@dev3'] }, () => {
describe('Domains spec', { tags: ['@dev3', '@xfail'] }, () => {
beforeEach(() => {
cy.login()
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-edge-dns-zone.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev4'] }, () => {
describe('Edge DNS spec', { tags: ['@dev4', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-a.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev4'] }, () => {
describe('Edge DNS spec', { tags: ['@dev4', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-aaaa.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev4'] }, () => {
describe('Edge DNS spec', { tags: ['@dev4', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-aname.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev4'] }, () => {
describe('Edge DNS spec', { tags: ['@dev4', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-caa.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev5'] }, () => {
describe('Edge DNS spec', { tags: ['@dev5', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-cname.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev5'] }, () => {
describe('Edge DNS spec', { tags: ['@dev5', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-ds.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev5'] }, () => {
describe('Edge DNS spec', { tags: ['@dev5', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-mx.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev5'] }, () => {
describe('Edge DNS spec', { tags: ['@dev5', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-ns.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev5'] }, () => {
describe('Edge DNS spec', { tags: ['@dev5', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-ptr.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev5'] }, () => {
describe('Edge DNS spec', { tags: ['@dev5', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-srv.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev5'] }, () => {
describe('Edge DNS spec', { tags: ['@dev5', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edge-dns/create-record-type-txt.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let zoneName = ''

describe('Edge DNS spec', { tags: ['@dev5'] }, () => {
describe('Edge DNS spec', { tags: ['@dev5', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
zoneName = generateUniqueName('DNSZone')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import selectors from '../../support/selectors'

let firewallName, functionInstanceName, ruleName

describe('Edge Firewall spec', { tags: ['@dev5'] }, () => {
describe('Edge Firewall spec', { tags: ['@dev5', '@xfail'] }, () => {
beforeEach(() => {
cy.login()
firewallName = generateUniqueName('EdgeFirewall')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const createASNNetworkListCase = () => {
cy.verifyToast('success', 'Your network list has been created')
}

describe('Edge Firewall spec', { tags: ['@dev5'] }, () => {
describe('Edge Firewall spec', { tags: ['@dev5', '@xfail'] }, () => {
beforeEach(() => {
cy.login()
firewallName = generateUniqueName('EdgeFirewall')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/network-lists/create-network-list-asn.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let networkListName

describe('Network Lists spec', { tags: ['@dev6'] }, () => {
describe('Network Lists spec', { tags: ['@dev6', '@xfail'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('Network Lists')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let networkListName

describe('Network Lists spec', { tags: ['@dev6'] }, () => {
describe('Network Lists spec', { tags: ['@dev6', '@xfail'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('Network Lists')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/variables/create-secret.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import selectors from '../../support/selectors'
let variableKey
let variableValue

describe('Variables spec', { tags: ['@dev2'] }, () => {
describe('Variables spec', { tags: ['@dev2', '@xfail'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('Variables')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let wafName

describe('WAF spec', { tags: ['@dev7'] }, () => {
describe('WAF spec', { tags: ['@dev7', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('WAF Rules')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let wafName

describe('WAF spec', { tags: ['@dev7'] }, () => {
describe('WAF spec', { tags: ['@dev7', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('WAF Rules')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let wafName

describe('WAF spec', { tags: ['@dev7'] }, () => {
describe('WAF spec', { tags: ['@dev7', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('WAF Rules')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/waf/create-allowed-rule-file-name.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let wafName

describe('WAF spec', { tags: ['@dev7'] }, () => {
describe('WAF spec', { tags: ['@dev7', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('WAF Rules')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/waf/create-allowed-rule-path-zone.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let wafName

describe('WAF spec', { tags: ['@dev7'] }, () => {
describe('WAF spec', { tags: ['@dev7', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('WAF Rules')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/waf/create-allowed-rule-raw-body.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let wafName

describe('WAF spec', { tags: ['@dev7'] }, () => {
describe('WAF spec', { tags: ['@dev7', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('WAF Rules')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/waf/create-waf-rule.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let wafName

describe('WAF spec', { tags: ['@dev7'] }, () => {
describe('WAF spec', { tags: ['@dev7', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('WAF Rules')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/waf/edit-waf-rule.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import selectors from '../../support/selectors'

let wafName

describe('WAF spec', { tags: ['@dev7'] }, () => {
describe('WAF spec', { tags: ['@dev7', '@dont_run_prod'] }, () => {
beforeEach(() => {
cy.login()
cy.openProduct('WAF Rules')
Expand Down
Loading

0 comments on commit 26f6b88

Please sign in to comment.