Skip to content

Commit

Permalink
[UXE-6357] feat: reactivate e2e tests and remove entity delete from t…
Browse files Browse the repository at this point in the history
…est cases (#2168)
  • Loading branch information
aloisio-m-bastian authored Feb 14, 2025
1 parent 49058c4 commit 14b23d2
Show file tree
Hide file tree
Showing 75 changed files with 189 additions and 784 deletions.
246 changes: 123 additions & 123 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,123 +41,123 @@ jobs:
coverage/unit/sonar-report.xml
retention-days: 1

# run-prod-e2e-tests:
# name: Run Dev E2E Tests
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# group: [2, 3, 4, 5, 6, 7]
# steps:
# - uses: actions/checkout@v4

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

# - name: Run Cypress Tests
# uses: cypress-io/github-action@v6
# env:
# 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
# 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

# - name: Validate Specs Tags
# run: node ./scripts/check_tags.js specs.json

# - name: Move Coverage Files
# run: mv .nyc_output/out.json .nyc_output/out_${{ matrix.group }}.json

# - name: Upload Cypress Screenshots
# if: ${{ failure() }}
# uses: actions/upload-artifact@v4
# with:
# name: cypress_screenshots_${{ matrix.group }}
# path: cypress/screenshots
# retention-days: 4

# - name: Upload Cypress Videos
# if: ${{ failure() }}
# uses: actions/upload-artifact@v4
# with:
# name: cypress_videos_${{ matrix.group }}
# path: cypress/videos
# retention-days: 1

# - name: Upload Coverage Files
# uses: actions/upload-artifact@v4
# with:
# name: coverage_report_${{ matrix.group }}
# path: .nyc_output/*
# retention-days: 1
# include-hidden-files: true

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

# steps:
# - name: Checkout Code
# uses: actions/checkout@v4

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

# - name: Install Dependencies
# run: npm install --global nyc

# - name: Download Coverage Artifacts
# uses: actions/download-artifact@v4
# with:
# path: coverage_report
# pattern: coverage_report_*
# merge-multiple: true

# - name: Merge Coverage Reports
# run: npx nyc merge ./coverage_report .nyc_output/out.json

# - name: Generate Text Coverage Report
# run: npx nyc report --reporter=text-summary

# - name: Generate HTML Coverage Report
# run: npx nyc report --reporter=html --report-dir=./coverage/e2e

# - name: Generate LCOV Report
# run: npx nyc report --reporter=lcovonly --report-dir=./coverage/e2e

# - name: Check E2E Test Coverage
# if: ${{ always() }}
# run: node ./scripts/check_coverage.js ./coverage/e2e/lcov.info 20

# - name: Compress Coverage Reports
# if: ${{ always() }}
# run: zip -r coverage.zip coverage

# - name: Upload Coverage Report Artifact
# if: ${{ always() }}
# uses: actions/upload-artifact@v4
# with:
# name: coverage_e2e_report
# path: coverage.zip
# retention-days: 7
run-prod-e2e-tests:
name: Run Dev E2E Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group: [2, 3, 4, 5, 6, 7]
steps:
- uses: actions/checkout@v4

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

- name: Run Cypress Tests
uses: cypress-io/github-action@v6
env:
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
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

- name: Validate Specs Tags
run: node ./scripts/check_tags.js specs.json

- name: Move Coverage Files
run: mv .nyc_output/out.json .nyc_output/out_${{ matrix.group }}.json

- name: Upload Cypress Screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: cypress_screenshots_${{ matrix.group }}
path: cypress/screenshots
retention-days: 4

- name: Upload Cypress Videos
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: cypress_videos_${{ matrix.group }}
path: cypress/videos
retention-days: 1

- name: Upload Coverage Files
uses: actions/upload-artifact@v4
with:
name: coverage_report_${{ matrix.group }}
path: .nyc_output/*
retention-days: 1
include-hidden-files: true

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

steps:
- name: Checkout Code
uses: actions/checkout@v4

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

- name: Install Dependencies
run: npm install --global nyc

- name: Download Coverage Artifacts
uses: actions/download-artifact@v4
with:
path: coverage_report
pattern: coverage_report_*
merge-multiple: true

- name: Merge Coverage Reports
run: npx nyc merge ./coverage_report .nyc_output/out.json

- name: Generate Text Coverage Report
run: npx nyc report --reporter=text-summary

- name: Generate HTML Coverage Report
run: npx nyc report --reporter=html --report-dir=./coverage/e2e

- name: Generate LCOV Report
run: npx nyc report --reporter=lcovonly --report-dir=./coverage/e2e

- name: Check E2E Test Coverage
if: ${{ always() }}
run: node ./scripts/check_coverage.js ./coverage/e2e/lcov.info 20

- name: Compress Coverage Reports
if: ${{ always() }}
run: zip -r coverage.zip coverage

- name: Upload Coverage Report Artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: coverage_e2e_report
path: coverage.zip
retention-days: 7

sonarcloud:
# needs: [run-tests, download_and_merge]
needs: [run-tests, download_and_merge]
needs: [run-tests]
runs-on: ubuntu-latest
steps:
Expand All @@ -169,15 +169,15 @@ jobs:
with:
name: coverage_unit_report

# - uses: actions/download-artifact@v4
# with:
# name: coverage_e2e_report
- uses: actions/download-artifact@v4
with:
name: coverage_e2e_report

# - name: Extract E2E Coverage Report
# run: |
# unzip coverage.zip -d coverage_e2e
# pwd
# find ./
- name: Extract E2E Coverage Report
run: |
unzip coverage.zip -d coverage_e2e
pwd
find ./
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@v2.3.0
Expand Down
7 changes: 0 additions & 7 deletions cypress/e2e/data-stream/create-data-stream-awskinesis.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,4 @@ describe('Data Stream spec', { tags: ['@dev2'] }, () => {
)
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,4 @@ describe('Data Stream spec', { tags: ['@dev2'] }, () => {
)
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
7 changes: 0 additions & 7 deletions cypress/e2e/data-stream/create-data-stream-azuremonitor.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,4 @@ describe('Data Stream spec', { tags: ['@dev2'] }, () => {
)
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
7 changes: 0 additions & 7 deletions cypress/e2e/data-stream/create-data-stream-bigquery.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,4 @@ describe('Data Stream spec', { tags: ['@dev2'] }, () => {
cy.get(selectors.dataStream.list.columnName('endpointType')).should('have.text', 'big_query')
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
7 changes: 0 additions & 7 deletions cypress/e2e/data-stream/create-data-stream-datadog.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,4 @@ describe('Data Stream spec', { tags: ['@dev2'] }, () => {
cy.get(selectors.dataStream.list.columnName('endpointType')).should('have.text', 'datadog')
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,4 @@ describe('Data Stream spec', { tags: ['@dev2'] }, () => {
)
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
7 changes: 0 additions & 7 deletions cypress/e2e/data-stream/create-data-stream-ibmqradar.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,4 @@ describe('Data Stream spec', { tags: ['@dev3'] }, () => {
cy.get(selectors.dataStream.list.columnName('endpointType')).should('have.text', 'qradar')
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
7 changes: 0 additions & 7 deletions cypress/e2e/data-stream/create-data-stream-kafka.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,4 @@ describe('Data Stream spec', { tags: ['@dev3'] }, () => {
cy.get(selectors.dataStream.list.columnName('endpointType')).should('have.text', 'kafka')
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
7 changes: 0 additions & 7 deletions cypress/e2e/data-stream/create-data-stream-s3.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,4 @@ describe('Data Stream spec', { tags: ['@dev3'] }, () => {
cy.get(selectors.dataStream.list.columnName('endpointType')).should('have.text', 's3')
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
7 changes: 0 additions & 7 deletions cypress/e2e/data-stream/create-data-stream-splunk.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,4 @@ describe('Data Stream spec', { tags: ['@dev3'] }, () => {
cy.get(selectors.dataStream.list.columnName('endpointType')).should('have.text', 'splunk')
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
7 changes: 0 additions & 7 deletions cypress/e2e/data-stream/create-data-stream-standard.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,4 @@ describe('Data Stream spec', { tags: ['@dev3'] }, () => {
cy.get(selectors.dataStream.list.columnName('endpointType')).should('have.text', 'standard')
cy.get(selectors.dataStream.list.columnName('active')).should('have.text', 'Active')
})

afterEach(() => {
// Cleanup
cy.deleteEntityFromList({ entityName: dataStreamName, productName: 'Data Stream' }).then(() => {
cy.verifyToast('Data Stream successfully deleted')
})
})
})
Loading

0 comments on commit 14b23d2

Please sign in to comment.