mirror of
https://github.com/frappe/lms.git
synced 2026-04-28 19:49:26 +03:00
ci: run ui tests parallely (#2232)
* ci: run ui tests parallely * ci: run ui tests parallely * ci: run ui tests parallely
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: UI
|
||||
name: UI Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -16,13 +16,14 @@ permissions:
|
||||
jobs:
|
||||
|
||||
test:
|
||||
name: UI Tests (Cypress) - ${{ matrix.containers }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
name: UI Tests (Cypress)
|
||||
matrix:
|
||||
containers: [1, 2]
|
||||
|
||||
services:
|
||||
mariadb:
|
||||
@@ -114,6 +115,15 @@ jobs:
|
||||
env:
|
||||
CYPRESS_BASE_URL: http://lms.test:8000
|
||||
CYPRESS_RECORD_KEY: 095366ec-7b9f-41bd-aeec-03bb76d627fe
|
||||
SPLIT: ${{ strategy.job-total }}
|
||||
SPLIT_INDEX: ${{ strategy.job-index }}
|
||||
|
||||
- name: Upload Cypress screenshots if tests fail
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cypress-screenshots-${{ matrix.containers }}
|
||||
path: cypress/screenshots
|
||||
|
||||
- name: Stop server and wait for coverage file
|
||||
run: |
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { defineConfig } from "cypress";
|
||||
import cypressSplit from "cypress-split";
|
||||
|
||||
export default defineConfig({
|
||||
projectId: "vandxn",
|
||||
@@ -14,5 +15,12 @@ export default defineConfig({
|
||||
},
|
||||
e2e: {
|
||||
baseUrl: "http://pertest:8000",
|
||||
setupNodeEvents(on, config) {
|
||||
// Splitting tests only works when Cypress Cloud is not orchestrating parallel runs.
|
||||
if (process.env.CYPRESS_CLOUD_PARALLEL !== "1") {
|
||||
cypressSplit(on, config);
|
||||
}
|
||||
return config;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
+2
-1
@@ -29,7 +29,8 @@
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"cypress": "^14.5.4",
|
||||
"cypress-file-upload": "^5.0.8",
|
||||
"cypress-real-events": "^1.14.0"
|
||||
"cypress-real-events": "^1.14.0",
|
||||
"cypress-split": "^1.24.28"
|
||||
},
|
||||
"dependencies": {
|
||||
"pre-commit": "^1.2.2"
|
||||
|
||||
Reference in New Issue
Block a user