diff --git a/.circleci/config.yml b/.circleci/config.yml index 9248b06d1..5db8b92ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -510,6 +510,7 @@ jobs: - restore_cache: *restore-npm-cache-linux - run: *install-npm-modules - save_cache: *save-npm-cache-linux + - run: mkdir ~/junit - create-e2e-account-file - android/create-avd: avd-name: Pixel_API_31_AOSP @@ -524,10 +525,17 @@ jobs: - run: name: Run Detox Tests 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 - store_artifacts: path: artifacts + - run: + command: cp junit.xml ~/junit/ + when: always + - store_test_results: + path: ~/junit + - store_artifacts: + path: ~/junit # iOS builds ios-build-experimental: @@ -593,6 +601,7 @@ jobs: - restore_cache: *restore-npm-cache-mac - run: *install-npm-modules - save_cache: *save-npm-cache-mac + - run: mkdir ~/junit - run: name: Configure Detox # Removes "nvm is not compatible with the "PREFIX" environment variable: currently set to "/usr/local"" error @@ -605,10 +614,17 @@ jobs: - run: name: Run tests 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 - store_artifacts: path: artifacts + - run: + command: cp junit.xml ~/junit/ + when: always + - store_test_results: + path: ~/junit + - store_artifacts: + path: ~/junit workflows: build-and-test: diff --git a/e2e/jest.config.js b/e2e/jest.config.js index d7bbea01f..91f196793 100644 --- a/e2e/jest.config.js +++ b/e2e/jest.config.js @@ -7,7 +7,7 @@ module.exports = { maxWorkers: process.env.CI ? 1 : 3, // ci already uses parallelism globalSetup: 'detox/runners/jest/globalSetup', globalTeardown: 'detox/runners/jest/globalTeardown', - reporters: ['detox/runners/jest/reporter'], + reporters: ['detox/runners/jest/reporter', 'jest-junit'], testEnvironment: 'detox/runners/jest/testEnvironment', verbose: true }; diff --git a/package.json b/package.json index 329043dda..9bf823a8c 100644 --- a/package.json +++ b/package.json @@ -209,6 +209,7 @@ "jest": "^28.1.3", "jest-cli": "^28.1.3", "jest-expo": "^46.0.1", + "jest-junit": "^15.0.0", "metro-react-native-babel-preset": "^0.67.0", "otp.js": "1.2.0", "patch-package": "6.4.7", @@ -241,6 +242,9 @@ "./jest.setup.js" ] }, + "jest-junit": { + "addFileAttribute": "true" + }, "snyk": true, "engines": { "node": ">=8.x", diff --git a/yarn.lock b/yarn.lock index f7aa0c333..4f6f18834 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13528,6 +13528,16 @@ jest-haste-map@^28.1.3: optionalDependencies: 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: version "28.1.3" 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" 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: version "14.0.0" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-14.0.0.tgz#876b5aec4f05ffd5feb97b0a871c855d16fbeb8c"