Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(tests): upgrade cypress and fix flaky tests #4170

Merged
merged 34 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1df6eb4
enh(tests): upgrade cypress
kduret May 22, 2024
b3f4dc7
Merge branch 'develop' into MON-upgrade-cypress
kduret May 22, 2024
0d0a3db
fix tests
kduret May 23, 2024
84de0e9
fixes
kduret May 23, 2024
40ae3a7
fixes
kduret May 23, 2024
8563550
Merge branch 'develop' into MON-upgrade-cypress
kduret May 23, 2024
12b47cd
fixes
kduret May 23, 2024
ef83d32
fix linting
kduret May 27, 2024
61ff6ea
fix linting
kduret May 27, 2024
48bd0cd
Merge branch 'develop' into MON-upgrade-cypress
kduret May 27, 2024
900fdc3
Merge branch 'develop' into MON-upgrade-cypress
kduret May 28, 2024
662cd03
fix linting
kduret May 28, 2024
0058502
fix linting
kduret May 28, 2024
a851162
fix linting
kduret May 29, 2024
624e116
fix linting
kduret May 29, 2024
ed2d047
fix
kduret May 29, 2024
f8bf914
Merge branch 'develop' into MON-upgrade-cypress
kduret May 30, 2024
bd8ed1f
fix
kduret May 30, 2024
d61841e
fix
kduret May 30, 2024
bf5e84f
fix
kduret May 30, 2024
12fd8d1
Merge branch 'develop' into MON-upgrade-cypress
kduret May 30, 2024
30bd0f2
Merge branch 'develop' into MON-upgrade-cypress
kduret May 31, 2024
95a639e
Merge branch 'develop' into MON-upgrade-cypress
kduret Jun 3, 2024
3f5a75f
fix
kduret Jun 3, 2024
7ebf86d
fix
kduret Jun 3, 2024
1595357
fix
kduret Jun 3, 2024
5b0d6a3
Merge branch 'develop' into MON-upgrade-cypress
kduret Jun 3, 2024
e9c24e7
fix
kduret Jun 4, 2024
097b81d
fix
kduret Jun 4, 2024
5aab380
fix
kduret Jun 4, 2024
14c203f
fix
kduret Jun 4, 2024
4ef9439
manage feedbacks from coderabbit
kduret Jun 6, 2024
1ca8022
fix
kduret Jun 6, 2024
775d9cd
Merge branch 'develop' into MON-upgrade-cypress
kduret Jun 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 0 additions & 71 deletions .github/actions/merge-artifacts/action.yml

This file was deleted.

21 changes: 11 additions & 10 deletions .github/workflows/behat-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,16 @@ jobs:
matrix:
type_of_report: [test-logs, test-reports]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Merging Artifacts
uses: ./.github/actions/merge-artifacts
- name: Merge Artifacts
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: ${{ contains(needs.behat-test-run.result, 'failure') }}
with:
target_name: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}
source_paths: |
${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}/**/*.xml
${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}/**/*.txt
source_name_pattern: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}-
github_token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}
pattern: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}-*
retention-days: 1

- name: Delete merged artifacts
uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1 # v5.0.0
with:
name: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}-*
failOnError: false
20 changes: 12 additions & 8 deletions .github/workflows/cypress-component-parallelization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,17 @@ jobs:
matrix:
type_of_report: [test-results, test-reports, test-coverage]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Merging Artifacts
uses: ./.github/actions/merge-artifacts
- name: Merge Artifacts
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: ${{ ( contains(needs.cypress-component-test-run.result, 'failure') && ( matrix.type_of_report == 'test-reports' ) ) || matrix.type_of_report == 'test-coverage' }}
with:
target_name: ${{ inputs.name }}-${{ matrix.type_of_report }}
source_paths: ${{ inputs.name }}-${{ matrix.type_of_report }}/**
source_name_pattern: ${{ inputs.name }}-${{ matrix.type_of_report }}-
github_token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ inputs.name }}-${{ matrix.type_of_report }}
pattern: ${{ inputs.name }}-${{ matrix.type_of_report }}-*
delete-merged: false # cannot be set to true due to random fails: Failed to DeleteArtifact: Unable to make request: ECONNRESET
retention-days: 1

- name: Delete merged artifacts
uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1 # v5.0.0
with:
name: ${{ inputs.name }}-${{ matrix.type_of_report }}-*
failOnError: false
20 changes: 12 additions & 8 deletions .github/workflows/cypress-e2e-parallelization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,17 @@ jobs:
matrix:
type_of_report: [test-results, test-reports, xray-reports]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Merging Artifacts
uses: ./.github/actions/merge-artifacts
- name: Merge Artifacts
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: ${{ ( contains(needs.cypress-e2e-test-run.result, 'failure') && ( matrix.type_of_report == 'test-results' || matrix.type_of_report == 'test-reports' ) ) || matrix.type_of_report == 'xray-reports' }}
with:
target_name: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}
source_paths: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}/**
source_name_pattern: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}-
github_token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}
pattern: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}-*
delete-merged: false # cannot be set to true due to random fails: Failed to DeleteArtifact: Unable to make request: ECONNRESET
retention-days: 1

- name: Delete merged artifacts
uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1 # v5.0.0
with:
name: ${{ inputs.name }}-${{ inputs.os }}-${{ matrix.type_of_report }}-*
failOnError: false
kduret marked this conversation as resolved.
Show resolved Hide resolved
19 changes: 11 additions & 8 deletions .github/workflows/newman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -712,13 +712,16 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Merging Artifacts
uses: ./.github/actions/merge-artifacts
- name: Merge Artifacts
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: ${{ contains(needs.newman-test-run.result, 'failure') }}
with:
target_name: postman-html-reports
source_paths: postman-html-reports/**/*.html
source_name_pattern: postman-html-reports-
github_token: ${{ secrets.GITHUB_TOKEN }}
name: postman-html-reports
pattern: postman-html-reports-*
retention-days: 1

- name: Delete merged artifacts
uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1 # v5.0.0
with:
name: postman-html-reports-*
failOnError: false
2 changes: 1 addition & 1 deletion centreon/config/features.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"notification" : 2,
"notification": 2,
"dashboard": 3,
"map_visx_viewer": 0,
"vault": 0,
Expand Down
6 changes: 5 additions & 1 deletion centreon/packages/js-config/cypress/e2e/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import './commands/monitoring';

import installLogsCollector from 'cypress-terminal-report/src/installLogsCollector';

installLogsCollector({ enableExtendedCollector: true });
installLogsCollector({
commandTimings: 'seconds',
enableExtendedCollector: true
});

const apiBase = '/centreon/api';
const apiActionV1 = `${apiBase}/index.php`;
Expand Down Expand Up @@ -260,6 +263,7 @@ Cypress.Commands.add(
return cy.get('.MuiAlert-message').then(($snackbar) => {
if ($snackbar.text().includes('Login succeeded')) {
cy.wait('@getNavigationList');
cy.get('.MuiAlert-message').should('not.be.visible');
}
});
}
Expand Down
6 changes: 4 additions & 2 deletions centreon/packages/js-config/cypress/e2e/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ export default ({
requestTimeout: 20000,
retries: 0,
screenshotsFolder: `${resultsFolder}/screenshots`,
video: true,
video: isDevelopment,
videoCompression: 0,
videosFolder: `${resultsFolder}/videos`
videosFolder: `${resultsFolder}/videos`,
viewportHeight: 1080,
viewportWidth: 1920
});
};
4 changes: 2 additions & 2 deletions centreon/packages/js-config/cypress/e2e/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export default (

// force screen to be non-retina and just use our given resolution
launchOptions.args.push('--force-device-scale-factor=1');
}

launchOptions.args.push(`--window-size=${width},${height}`);
launchOptions.args.push(`--window-size=${width},${height}`);
}

return launchOptions;
});
Expand Down
12 changes: 6 additions & 6 deletions centreon/packages/js-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"prettier": "^3.0.0"
},
"dependencies": {
"@badeball/cypress-cucumber-preprocessor": "^20.0.1",
"@badeball/cypress-cucumber-preprocessor": "^20.0.5",
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.0",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
Expand All @@ -30,9 +30,9 @@
"@types/cypress-cucumber-preprocessor": "^4.0.5",
"cypress": "^13.6.4",
"cypress-multi-reporters": "^1.6.4",
"cypress-terminal-report": "^6.0.0",
"cypress-terminal-report": "^6.0.2",
"cypress-wait-until": "^3.0.1",
"dotenv": "^16.4.1",
"dotenv": "^16.4.5",
"esbuild": "^0.20.0",
"eslint": "^8.53.0",
"eslint-config-airbnb": "19.0.4",
Expand All @@ -52,8 +52,8 @@
"eslint-plugin-sort-keys-fix": "^1.1.2",
"eslint-plugin-typescript-sort-keys": "^2.1.0",
"mochawesome": "^7.1.3",
"mysql2": "^3.9.1",
"tar-fs": "^3.0.4",
"testcontainers": "^10.7.1"
"mysql2": "^3.9.7",
"tar-fs": "^3.0.6",
"testcontainers": "^10.9.0"
}
}
Loading
Loading