Try split by timing

This commit is contained in:
Diego Mello 2023-02-27 17:21:04 -03:00
parent 3960a53060
commit ee3a42c18f
4 changed files with 38 additions and 3 deletions

View File

@ -510,6 +510,7 @@ jobs:
- restore_cache: *restore-npm-cache-linux - restore_cache: *restore-npm-cache-linux
- run: *install-npm-modules - run: *install-npm-modules
- save_cache: *save-npm-cache-linux - save_cache: *save-npm-cache-linux
- run: mkdir ~/junit
- create-e2e-account-file - create-e2e-account-file
- android/create-avd: - android/create-avd:
avd-name: Pixel_API_31_AOSP avd-name: Pixel_API_31_AOSP
@ -524,10 +525,17 @@ jobs:
- run: - run:
name: Run Detox Tests name: Run Detox Tests
command: | command: |
TEST=$(circleci tests glob "e2e/tests/**/*.ts" | circleci tests split) TEST=$(circleci tests glob "e2e/tests/**/*.ts" | circleci tests split --split-by=timings)
yarn e2e:android-test $TEST yarn e2e:android-test $TEST
- store_artifacts: - store_artifacts:
path: artifacts path: artifacts
- run:
command: cp junit.xml ~/junit/
when: always
- store_test_results:
path: ~/junit
- store_artifacts:
path: ~/junit
# iOS builds # iOS builds
ios-build-experimental: ios-build-experimental:
@ -593,6 +601,7 @@ jobs:
- restore_cache: *restore-npm-cache-mac - restore_cache: *restore-npm-cache-mac
- run: *install-npm-modules - run: *install-npm-modules
- save_cache: *save-npm-cache-mac - save_cache: *save-npm-cache-mac
- run: mkdir ~/junit
- run: - run:
name: Configure Detox name: Configure Detox
# Removes "nvm is not compatible with the "PREFIX" environment variable: currently set to "/usr/local"" error # Removes "nvm is not compatible with the "PREFIX" environment variable: currently set to "/usr/local"" error
@ -605,10 +614,17 @@ jobs:
- run: - run:
name: Run tests name: Run tests
command: | command: |
TEST=$(circleci tests glob "e2e/tests/**/*.ts" | circleci tests split) TEST=$(circleci tests glob "e2e/tests/**/*.ts" | circleci tests split --split-by=timings)
yarn e2e:ios-test $TEST yarn e2e:ios-test $TEST
- store_artifacts: - store_artifacts:
path: artifacts path: artifacts
- run:
command: cp junit.xml ~/junit/
when: always
- store_test_results:
path: ~/junit
- store_artifacts:
path: ~/junit
workflows: workflows:
build-and-test: build-and-test:

View File

@ -7,7 +7,7 @@ module.exports = {
maxWorkers: process.env.CI ? 1 : 3, // ci already uses parallelism maxWorkers: process.env.CI ? 1 : 3, // ci already uses parallelism
globalSetup: 'detox/runners/jest/globalSetup', globalSetup: 'detox/runners/jest/globalSetup',
globalTeardown: 'detox/runners/jest/globalTeardown', globalTeardown: 'detox/runners/jest/globalTeardown',
reporters: ['detox/runners/jest/reporter'], reporters: ['detox/runners/jest/reporter', 'jest-junit'],
testEnvironment: 'detox/runners/jest/testEnvironment', testEnvironment: 'detox/runners/jest/testEnvironment',
verbose: true verbose: true
}; };

View File

@ -209,6 +209,7 @@
"jest": "^28.1.3", "jest": "^28.1.3",
"jest-cli": "^28.1.3", "jest-cli": "^28.1.3",
"jest-expo": "^46.0.1", "jest-expo": "^46.0.1",
"jest-junit": "^15.0.0",
"metro-react-native-babel-preset": "^0.67.0", "metro-react-native-babel-preset": "^0.67.0",
"otp.js": "1.2.0", "otp.js": "1.2.0",
"patch-package": "6.4.7", "patch-package": "6.4.7",
@ -241,6 +242,9 @@
"./jest.setup.js" "./jest.setup.js"
] ]
}, },
"jest-junit": {
"addFileAttribute": "true"
},
"snyk": true, "snyk": true,
"engines": { "engines": {
"node": ">=8.x", "node": ">=8.x",

View File

@ -13528,6 +13528,16 @@ jest-haste-map@^28.1.3:
optionalDependencies: optionalDependencies:
fsevents "^2.3.2" fsevents "^2.3.2"
jest-junit@^15.0.0:
version "15.0.0"
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-15.0.0.tgz#a47544ab42e9f8fe7ada56306c218e09e52bd690"
integrity sha512-Z5sVX0Ag3HZdMUnD5DFlG+1gciIFSy7yIVPhOdGUi8YJaI9iLvvBb530gtQL2CHmv0JJeiwRZenr0VrSR7frvg==
dependencies:
mkdirp "^1.0.4"
strip-ansi "^6.0.1"
uuid "^8.3.2"
xml "^1.0.1"
jest-leak-detector@^28.1.3: jest-leak-detector@^28.1.3:
version "28.1.3" version "28.1.3"
resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz#a6685d9b074be99e3adee816ce84fd30795e654d" resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz#a6685d9b074be99e3adee816ce84fd30795e654d"
@ -21055,6 +21065,11 @@ xml2js@0.4.23, xml2js@^0.4.5:
sax ">=0.6.0" sax ">=0.6.0"
xmlbuilder "~11.0.0" xmlbuilder "~11.0.0"
xml@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==
xmlbuilder@^14.0.0: xmlbuilder@^14.0.0:
version "14.0.0" version "14.0.0"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-14.0.0.tgz#876b5aec4f05ffd5feb97b0a871c855d16fbeb8c" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-14.0.0.tgz#876b5aec4f05ffd5feb97b0a871c855d16fbeb8c"