Skip to content

Commit 6d77923

Browse files
authored
fix e2e tests (failed after async changes) (#3063)
by running calendar and newsfeed tests last. Additional change: allow unit tests to run parallel This is no fix of the real issue of calendar and newsfeed tests but I moved them to the end of the tests so other tests are not failing anymore. There are coming follow up PR's for the real fixes (when I find the culprits). With these change we can stay with the async changes done by @rejas and #3060 is obsolete.
1 parent beea754 commit 6d77923

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ _This release is scheduled to be released on 2023-04-01._
5454
- Fix precipitation css styles and rounding value
5555
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
5656
- Fix empty news feed stopping the reload forever
57+
- Fix e2e tests (failed after async changes) by running calendar and newsfeed tests last
5758

5859
## [2.22.0] - 2023-01-01
5960

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"test:coverage": "NODE_ENV=test jest --coverage -i --verbose false --forceExit",
1717
"test:electron": "NODE_ENV=test jest --selectProjects electron -i --forceExit",
1818
"test:e2e": "NODE_ENV=test jest --selectProjects e2e -i --forceExit",
19-
"test:unit": "NODE_ENV=test jest --selectProjects unit -i --forceExit",
19+
"test:unit": "NODE_ENV=test jest --selectProjects unit",
2020
"test:prettier": "prettier . --check",
2121
"test:js": "eslint 'js/**/*.js' 'modules/default/**/*.js' 'clientonly/*.js' 'serveronly/*.js' 'translations/*.js' 'vendor/*.js' 'tests/**/*.js' 'config/*' --config .eslintrc.json",
2222
"test:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json",

tests/utils/test_sequencer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ const TestSequencer = require("@jest/test-sequencer").default;
22

33
class CustomSequencer extends TestSequencer {
44
sort(tests) {
5-
const orderPath = ["unit", "e2e", "electron"];
5+
const orderPath = ["unit", "electron", "e2e"];
66
return tests.sort((testA, testB) => {
77
let indexA = -1;
88
let indexB = -1;
99
const reg = ".*/tests/([^/]*).*";
1010

11+
// move calendar and newsfeed at the end
12+
if (testA.path.includes("e2e/modules/calendar_spec") || testA.path.includes("e2e/modules/newsfeed_spec")) return 1;
13+
if (testB.path.includes("e2e/modules/calendar_spec") || testB.path.includes("e2e/modules/newsfeed_spec")) return -1;
14+
1115
let matchA = new RegExp(reg, "g").exec(testA.path);
1216
if (matchA.length > 0) indexA = orderPath.indexOf(matchA[1]);
1317

0 commit comments

Comments
 (0)