Skip to content

Commit 649ced3

Browse files
Make e2e test results available in Bitrise (#6136)
* make android test published even on failure * test with bitrise upload v2 * removed spec test debug report ios debug report ios debug report ios debug report ios debug report ios debug report ios debug report ios debug report ios move working code to ios e2e workflow delete test report remove debug and useless param update lock file * debug with only one iOS test case * debug with only one failing iOS test case * debug with only one failing iOS test case * debug with only one failing iOS test case * debug with only one failing iOS test case * remove debug test * add test reports to gitignore file --------- Co-authored-by: Curtis <Curtis.David7@gmail.com>
1 parent 0fac567 commit 649ced3

File tree

5 files changed

+64
-23
lines changed

5 files changed

+64
-23
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,6 @@ browserstack.err
9999
# Detox
100100
# Artifacts generated by failing e2e tests
101101
/artifacts
102+
103+
# Reports generated by tests
104+
e2e/reports

bitrise.yml

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,18 @@ workflows:
210210
METAMASK_ENVIRONMENT='production' yarn test:e2e:ios
211211
title: Detox Build & Test
212212
is_always_run: false
213+
- custom-test-results-export@1:
214+
is_always_run: true
215+
is_skippable: false
216+
title: Export test results
217+
inputs:
218+
- base_path: $BITRISE_SOURCE_DIR/e2e/reports/
219+
- test_name: E2E Tests
220+
- search_pattern: $BITRISE_SOURCE_DIR/e2e/reports/junit.xml
221+
- deploy-to-bitrise-io@2:
222+
is_always_run: true
223+
is_skippable: false
224+
title: Deploy test report files
213225
start_e2e_tests:
214226
steps:
215227
- build-router-start@0:
@@ -258,7 +270,7 @@ workflows:
258270
- abort_on_fail: 'yes'
259271
- build_artifacts_save_path: $BITRISE_DEPLOY_DIR
260272
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
261-
- deploy-to-bitrise-io@1:
273+
- deploy-to-bitrise-io@2:
262274
is_always_run: false
263275
is_skippable: true
264276
inputs:
@@ -315,31 +327,31 @@ workflows:
315327
METAMASK_ENVIRONMENT='production' yarn build:android:pre-release:bundle
316328
title: Build Android Pre-Release Bundle
317329
is_always_run: false
318-
- deploy-to-bitrise-io@1:
330+
- deploy-to-bitrise-io@2:
319331
is_always_run: false
320332
is_skippable: true
321333
inputs:
322334
- deploy_path: $PROJECT_LOCATION/app/build/outputs/apk/prod/release/app-prod-release.apk
323335
title: Bitrise Deploy APK
324-
- deploy-to-bitrise-io@1:
336+
- deploy-to-bitrise-io@2:
325337
is_always_run: false
326338
is_skippable: true
327339
inputs:
328340
- deploy_path: $PROJECT_LOCATION/app/build/outputs/apk/prod/release/sha512sums.txt
329341
title: Bitrise Deploy Checksum
330-
- deploy-to-bitrise-io@1:
342+
- deploy-to-bitrise-io@2:
331343
is_always_run: false
332344
is_skippable: true
333345
inputs:
334346
- deploy_path: $PROJECT_LOCATION/app/build/outputs/mapping/prodRelease/mapping.txt
335347
title: Bitrise ProGuard Map Files
336-
- deploy-to-bitrise-io@1:
348+
- deploy-to-bitrise-io@2:
337349
is_always_run: false
338350
is_skippable: true
339351
inputs:
340352
- deploy_path: $PROJECT_LOCATION/app/build/outputs/bundle/prodRelease/app-prod-release.aab
341353
title: Bitrise Deploy AAB
342-
- deploy-to-bitrise-io@1:
354+
- deploy-to-bitrise-io@2:
343355
is_always_run: false
344356
is_skippable: true
345357
inputs:
@@ -373,31 +385,31 @@ workflows:
373385
GIT_BRANCH=$BITRISE_GIT_BRANCH METAMASK_ENVIRONMENT='qa' yarn build:android:pre-release:bundle:qa
374386
title: Build Android Pre-Release Bundle
375387
is_always_run: false
376-
- deploy-to-bitrise-io@1:
388+
- deploy-to-bitrise-io@2:
377389
is_always_run: false
378390
is_skippable: true
379391
inputs:
380392
- deploy_path: $PROJECT_LOCATION/app/build/outputs/apk/qa/release/app-qa-release.apk
381393
title: Bitrise Deploy APK
382-
- deploy-to-bitrise-io@1:
394+
- deploy-to-bitrise-io@2:
383395
is_always_run: false
384396
is_skippable: true
385397
inputs:
386398
- deploy_path: $PROJECT_LOCATION/app/build/outputs/apk/qa/release/sha512sums.txt
387399
title: Bitrise Deploy Checksum
388-
- deploy-to-bitrise-io@1:
400+
- deploy-to-bitrise-io@2:
389401
is_always_run: false
390402
is_skippable: true
391403
inputs:
392404
- deploy_path: $PROJECT_LOCATION/app/build/outputs/mapping/qaRelease/mapping.txt
393405
title: Bitrise ProGuard Map Files
394-
- deploy-to-bitrise-io@1:
406+
- deploy-to-bitrise-io@2:
395407
is_always_run: false
396408
is_skippable: true
397409
inputs:
398410
- deploy_path: $PROJECT_LOCATION/app/build/outputs/bundle/qaRelease/app-qa-release.aab
399411
title: Bitrise Deploy AAB
400-
- deploy-to-bitrise-io@1:
412+
- deploy-to-bitrise-io@2:
401413
is_always_run: false
402414
is_skippable: true
403415
inputs:
@@ -418,7 +430,7 @@ workflows:
418430
CUSTOM_ID=${CUSTOM_ID////-}
419431
curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@$APK_PATH" -F 'data={"custom_id": "'$CUSTOM_ID'"}' | jq -j '.app_url' | envman add --key BROWSERSTACK_APP_URL
420432
curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" -X GET https://api-cloud.browserstack.com/app-automate/recent_apps | jq > browserstack_uploaded_apps.json
421-
- deploy-to-bitrise-io@1:
433+
- deploy-to-bitrise-io@2:
422434
is_always_run: false
423435
is_skippable: true
424436
inputs:
@@ -453,14 +465,15 @@ workflows:
453465
yarn test:wdio:android:browserstack
454466
- script@1:
455467
is_always_run: true
468+
is_skippable: false
456469
title: Add tests reports to Bitrise
457470
inputs:
458471
- content: |-
459472
#!/usr/bin/env bash
460473
cp -r $BITRISE_SOURCE_DIR/wdio/reports/junit-results/ $BITRISE_TEST_RESULT_DIR/
461-
- deploy-to-bitrise-io@1:
462-
is_always_run: false
463-
is_skippable: true
474+
- deploy-to-bitrise-io@2:
475+
is_always_run: true
476+
is_skippable: false
464477
inputs:
465478
- deploy_path: $BITRISE_TEST_RESULT_DIR
466479
title: Deploy test report files
@@ -506,19 +519,19 @@ workflows:
506519
METAMASK_ENVIRONMENT='production' yarn build:ios:pre-release
507520
title: iOS Sourcemaps & Build
508521
is_always_run: false
509-
- deploy-to-bitrise-io@1:
522+
- deploy-to-bitrise-io@2:
510523
is_always_run: false
511524
is_skippable: true
512525
inputs:
513526
- deploy_path: ios/build/output/MetaMask.ipa
514527
title: Deploy iOS IPA
515-
- deploy-to-bitrise-io@1:
528+
- deploy-to-bitrise-io@2:
516529
is_always_run: false
517530
is_skippable: true
518531
inputs:
519532
- deploy_path: ios/build/MetaMask.xcarchive
520533
title: Deploy Symbols File
521-
- deploy-to-bitrise-io@1:
534+
- deploy-to-bitrise-io@2:
522535
is_always_run: false
523536
is_skippable: true
524537
inputs:
@@ -545,19 +558,19 @@ workflows:
545558
GIT_BRANCH=$BITRISE_GIT_BRANCH METAMASK_ENVIRONMENT='qa' yarn build:ios:pre-qa
546559
title: iOS Sourcemaps & Build
547560
is_always_run: false
548-
- deploy-to-bitrise-io@1:
561+
- deploy-to-bitrise-io@2:
549562
is_always_run: false
550563
is_skippable: true
551564
inputs:
552565
- deploy_path: ios/build/output/MetaMask-QA.ipa
553566
title: Deploy iOS IPA
554-
- deploy-to-bitrise-io@1:
567+
- deploy-to-bitrise-io@2:
555568
is_always_run: false
556569
is_skippable: true
557570
inputs:
558571
- deploy_path: ios/build/MetaMask-QA.xcarchive
559572
title: Deploy Symbols File
560-
- deploy-to-bitrise-io@1:
573+
- deploy-to-bitrise-io@2:
561574
is_always_run: false
562575
is_skippable: true
563576
inputs:

e2e/config.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,14 @@
55
"forceExit": true,
66
"transform": {
77
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
8-
}
8+
},
9+
"reporters": [
10+
"default",
11+
[
12+
"jest-junit",
13+
{
14+
"outputDirectory": "./e2e/reports"
15+
}
16+
]
17+
]
918
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@
153153
"@metamask/message-manager": "^1.0.1",
154154
"@metamask/network-controller": "^2.0.0",
155155
"@metamask/permission-controller": "^1.0.2",
156+
"@metamask/phishing-controller": "^2.0.0",
156157
"@metamask/preferences-controller": "^2.1.0",
157158
"@metamask/sdk-communication-layer": "0.2.0",
158-
"@metamask/phishing-controller": "^2.0.0",
159159
"@metamask/swaps-controller": "^6.8.0",
160160
"@metamask/transaction-controller": "^2.0.0",
161161
"@ngraveio/bc-ur": "^1.1.6",
@@ -376,6 +376,7 @@
376376
"fs-extra": "^10.1.0",
377377
"husky": "1.3.1",
378378
"jest": "^26.6.3",
379+
"jest-junit": "^15.0.0",
379380
"jest-serializer": "26.6.2",
380381
"jetifier": "2.0.0",
381382
"lint-staged": "10.5.4",

yarn.lock

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15470,6 +15470,16 @@ jest-jasmine2@^26.6.3:
1547015470
pretty-format "^26.6.2"
1547115471
throat "^5.0.0"
1547215472

15473+
jest-junit@^15.0.0:
15474+
version "15.0.0"
15475+
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-15.0.0.tgz#a47544ab42e9f8fe7ada56306c218e09e52bd690"
15476+
integrity sha512-Z5sVX0Ag3HZdMUnD5DFlG+1gciIFSy7yIVPhOdGUi8YJaI9iLvvBb530gtQL2CHmv0JJeiwRZenr0VrSR7frvg==
15477+
dependencies:
15478+
mkdirp "^1.0.4"
15479+
strip-ansi "^6.0.1"
15480+
uuid "^8.3.2"
15481+
xml "^1.0.1"
15482+
1547315483
jest-leak-detector@^26.6.2:
1547415484
version "26.6.2"
1547515485
resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz#7717cf118b92238f2eba65054c8a0c9c653a91af"
@@ -24887,6 +24897,11 @@ xml2js@^0.4.17, xml2js@^0.4.23, xml2js@^0.4.5:
2488724897
sax ">=0.6.0"
2488824898
xmlbuilder "~11.0.0"
2488924899

24900+
xml@^1.0.1:
24901+
version "1.0.1"
24902+
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
24903+
integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==
24904+
2489024905
xmlbuilder@^15.1.1:
2489124906
version "15.1.1"
2489224907
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-15.1.1.tgz#9dcdce49eea66d8d10b42cae94a79c3c8d0c2ec5"

0 commit comments

Comments
 (0)