fix: refs #6695 update Cypress configuration and test result paths
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Alex Moreno 2025-02-26 12:13:26 +01:00
parent aa6ec5d6b1
commit 9ac6db2c5d
5 changed files with 13 additions and 7 deletions

1
.gitignore vendored
View File

@ -31,6 +31,7 @@ yarn-error.log*
# Cypress directories and files # Cypress directories and files
/test/cypress/videos /test/cypress/videos
/test/cypress/screenshots /test/cypress/screenshots
/junit
# VitePress directories and files # VitePress directories and files
/docs/.vitepress/cache /docs/.vitepress/cache

4
Jenkinsfile vendored
View File

@ -116,7 +116,7 @@ pipeline {
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
sh "docker-compose ${env.COMPOSE_PARAMS} up -d" sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") { image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
sh 'cypress run' sh 'cypress run --browser chromium || true'
// sh ''' // sh '''
// find test/cypress/integration -name "*.spec.js" | xargs -n 1 -P 2 -I {} sh -c "xvfb-run -a cypress run --headless --browser chromium --spec '{}'" // find test/cypress/integration -name "*.spec.js" | xargs -n 1 -P 2 -I {} sh -c "xvfb-run -a cypress run --headless --browser chromium --spec '{}'"
// wait // wait
@ -128,7 +128,7 @@ pipeline {
always { always {
sh "docker-compose ${env.COMPOSE_PARAMS} down -v" sh "docker-compose ${env.COMPOSE_PARAMS} down -v"
junit( junit(
testResults: 'test/cypress/results/junit-*.xml', testResults: 'junit/e2e-*.xml',
allowEmptyResults: true allowEmptyResults: true
) )
} }

View File

@ -1,6 +1,6 @@
import { defineConfig } from 'cypress'; import { defineConfig } from 'cypress';
let urlHost, reporter, reporterOptions; let urlHost, reporter, reporterOptions, defaultCommandTimeout;
if (process.env.CI) { if (process.env.CI) {
urlHost = 'front'; urlHost = 'front';
@ -8,7 +8,7 @@ if (process.env.CI) {
reporterOptions = { reporterOptions = {
reporterEnabled: 'mocha-junit-reporter, mochawesome', reporterEnabled: 'mocha-junit-reporter, mochawesome',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: 'test/cypress/results/junit-[hash].xml', mochaFile: 'junit/e2e-[hash].xml',
}, },
mochawesomeReporterOptions: { mochawesomeReporterOptions: {
reportDir: 'test/cypress/results', reportDir: 'test/cypress/results',
@ -17,6 +17,7 @@ if (process.env.CI) {
json: false, json: false,
}, },
}; };
defaultCommandTimeout = 30000;
} else { } else {
urlHost = 'localhost'; urlHost = 'localhost';
reporter = 'cypress-mochawesome-reporter'; reporter = 'cypress-mochawesome-reporter';
@ -28,13 +29,14 @@ if (process.env.CI) {
reportDir: 'test/cypress/reports', reportDir: 'test/cypress/reports',
inlineAssets: true, inlineAssets: true,
}; };
defaultCommandTimeout = 10000;
} }
export default defineConfig({ export default defineConfig({
e2e: { e2e: {
baseUrl: `http://${urlHost}:9000`, baseUrl: `http://${urlHost}:9000`,
experimentalStudio: false, experimentalStudio: false,
defaultCommandTimeout: 10000, defaultCommandTimeout,
trashAssetsBeforeRuns: false, trashAssetsBeforeRuns: false,
requestTimeout: 10000, requestTimeout: 10000,
responseTimeout: 30000, responseTimeout: 30000,
@ -59,7 +61,6 @@ export default defineConfig({
viewportWidth: 1280, viewportWidth: 1280,
viewportHeight: 720, viewportHeight: 720,
}, },
experimentalMemoryManagement: true, defaultCommandTimeout,
defaultCommandTimeout: 10000,
numTestsKeptInMemory: 0, numTestsKeptInMemory: 0,
}); });

View File

@ -54,6 +54,7 @@
"eslint-plugin-cypress": "^4.1.0", "eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-vue": "^9.32.0", "eslint-plugin-vue": "^9.32.0",
"husky": "^8.0.0", "husky": "^8.0.0",
"mocha": "^11.1.0",
"mocha-junit-reporter": "^2.2.1", "mocha-junit-reporter": "^2.2.1",
"mocha-multi-reporters": "^1.5.1", "mocha-multi-reporters": "^1.5.1",
"mochawesome": "^7.1.3", "mochawesome": "^7.1.3",

View File

@ -91,6 +91,9 @@ devDependencies:
husky: husky:
specifier: ^8.0.0 specifier: ^8.0.0
version: 8.0.3 version: 8.0.3
mocha:
specifier: ^11.1.0
version: 11.1.0
mocha-junit-reporter: mocha-junit-reporter:
specifier: ^2.2.1 specifier: ^2.2.1
version: 2.2.1(mocha@11.1.0) version: 2.2.1(mocha@11.1.0)