aboutsummaryrefslogtreecommitdiffstats
path: root/cypress.config.ts
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-10-21 18:33:05 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2023-10-21 18:42:08 +0200
commit37d53d6b7972862657c3a077dd3c74abda65e966 (patch)
tree3d953d4ed74326de89c5d8d2644ef358b85e60a5 /cypress.config.ts
parent5c2610af7dbce72fa1c1b02185a2c28cd5be004e (diff)
downloadnextcloud-server-37d53d6b7972862657c3a077dd3c74abda65e966.tar.gz
nextcloud-server-37d53d6b7972862657c3a077dd3c74abda65e966.zip
feat(cypress): Always run cypress CI in parallel (independent from cypress.io)
The server always exceeds the free Cypress.io time so there is no benefit using it unless we go for the enterprise plan. So this simply uses `cypress-split` to split the specs and run them in parallel CI workers (only e2e tests). Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress.config.ts')
-rw-r--r--cypress.config.ts25
1 files changed, 13 insertions, 12 deletions
diff --git a/cypress.config.ts b/cypress.config.ts
index 4f15c9a2a23..8aa4bd48b24 100644
--- a/cypress.config.ts
+++ b/cypress.config.ts
@@ -6,6 +6,7 @@ import {
waitOnNextcloud,
} from './cypress/dockerNode'
import { defineConfig } from 'cypress'
+import cypressSplit from 'cypress-split'
import webpackPreprocessor from '@cypress/webpack-preprocessor'
import type { Configuration } from 'webpack'
@@ -47,6 +48,8 @@ export default defineConfig({
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
async setupNodeEvents(on, config) {
+ cypressSplit(on, config)
+
on('file:preprocessor', webpackPreprocessor({ webpackOptions: webpackConfig as Configuration }))
// Disable spell checking to prevent rendering differences
@@ -76,18 +79,16 @@ export default defineConfig({
// Before the browser launches
// starting Nextcloud testing container
- return startNextcloud(process.env.BRANCH)
- .then((ip) => {
- // Setting container's IP as base Url
- config.baseUrl = `http://${ip}/index.php`
- return ip
- })
- .then(waitOnNextcloud)
- .then(configureNextcloud)
- .then(applyChangesToNextcloud)
- .then(() => {
- return config
- })
+ const ip = await startNextcloud(process.env.BRANCH)
+
+ // Setting container's IP as base Url
+ config.baseUrl = `http://${ip}/index.php`
+ await waitOnNextcloud(ip)
+ await configureNextcloud()
+ await applyChangesToNextcloud()
+
+ // IMPORTANT: return the config otherwise cypress-split will not work
+ return config
},
},