Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fastlane notices error code when generating l10n screenshots but ignores it #6549

Closed
JohanLorenzo opened this issue May 6, 2020 · 5 comments
Labels
Bug 🐞 This is a bug with existing functionality not behaving as expected eng:automation This is a task or bug affecting the automated tests

Comments

@JohanLorenzo
Copy link
Contributor

JohanLorenzo commented May 6, 2020

See bug 1622800 comment 15 for the full context.

Steps to reproduce

  1. Trigger https://firefox-ci-tc.services.mozilla.com/hooks/project-releng/cron-task-mozilla-mobile-firefox-ios%2Fl10-screenshots
  2. Wait for some jobs to complete
  3. Have a look at the logs.

Expected behavior

fastlane should report an error whenever l10n screenshots aren't fully generated, because an emulator crash for instance.

Actual behavior

The fastlane command outputs it succeeded and returns 0 as an exit code. See logs below, as an example.

EDIT: The following is wrong. See #6549 (comment) for accurate data.

Repro rate: It happened on 31 locales out of 92.

@isabelrios Would you have an idea of what might cause this discrepancy?

EDIT: These logs don't show the actual problem.

[16:21:19]: Running snapshot on: iPhone 8
[16:21:19]: $ set -o pipefail && xcodebuild -scheme L10nSnapshotTests -project Client.xcodeproj -derivedDataPath 'l10n-screenshots-dd' -destination 'platform=iOS Simulator,name=iPhone 8,OS=13.4.1' FASTLANE_SNAPSHOT=YES test-without-building | tee /Users/vagrant/Library/Logs/snapshot/L10nSnapshotTests-L10nSnapshotTests.log | xcpretty 
[16:21:19]: ▸ Loading...
[16:21:21]: ▸ 2020-05-05 16:21:21.614 xcodebuild[4275:95171]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
[16:21:21]: ▸ /Users/vagrant/git/l10n-screenshots-dd/Logs/Test/Test-L10nSnapshotTests-2020.05.05_16-21-21-+0000.xcresult/Staging/1_Test/Diagnostics/L10nSnapshotTests-1C4ADD82-0C84-439F-9F2F-3CEB08BAE825/L10nSnapshotTests-3D773190-207C-4DF3-9241-925DC267C2D7/Session-L10nSnapshotTests-2020-05-05_162121-FRFGZL.log
[16:21:21]: ▸ 2020-05-05 16:21:21.615 xcodebuild[4275:95115] [MT] IDETestOperationsObserverDebug: (275A8B71-9F66-4FDE-B6E6-B1D40BB4F513) Beginning test session L10nSnapshotTests-275A8B71-9F66-4FDE-B6E6-B1D40BB4F513 at 2020-05-05 16:21:21.615 with Xcode 11E503a on target <DVTiPhoneSimulator: 0x7f9283c916a0> {
[16:21:21]: ▸ 		SimDevice: Clone 1 of iPhone 8 (DD473314-0530-4E4A-A2F5-5F32A1776CE3, iOS 13.4, Shutdown)
[16:21:21]: ▸ } (13.4.1 (17E8260))
[16:21:32]: ▸ 2020-05-05 16:21:32.495 xcodebuild[4275:95115] [MT] IDETestOperationsObserverDebug: (275A8B71-9F66-4FDE-B6E6-B1D40BB4F513) Finished requesting crash reports. Continuing with testing.
[16:21:53]: ▸ 2020-05-05 16:21:53.606 xcodebuild[4275:95115] [MT] IDETestOperationsObserverDebug: (47648418-8021-425D-BD13-C65E3DA2D979) Beginning test session L10nSnapshotTests-47648418-8021-425D-BD13-C65E3DA2D979 at 2020-05-05 16:21:53.606 with Xcode 11E503a on target <DVTiPhoneSimulator: 0x7f9284f7ef30> {
[16:21:53]: ▸ 		SimDevice: Clone 2 of iPhone 8 (678CCCDC-27AA-43B6-A9E7-4292B757585F, iOS 13.4, Shutdown)
[16:21:53]: ▸ } (13.4.1 (17E8260))
[16:21:53]: ▸ 2020-05-05 16:21:53.610 xcodebuild[4275:95283]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
[16:21:53]: ▸ /Users/vagrant/git/l10n-screenshots-dd/Logs/Test/Test-L10nSnapshotTests-2020.05.05_16-21-21-+0000.xcresult/Staging/1_Test/Diagnostics/L10nSnapshotTests-1C4ADD82-0C84-439F-9F2F-3CEB08BAE825/L10nSnapshotTests-E3AB49DF-AF9D-44D9-822C-0AB0B664EE3F/Session-L10nSnapshotTests-2020-05-05_162153-L20siY.log
[16:21:53]: ▸ 2020-05-05 16:21:53.714 xcodebuild[4275:101117]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
[16:21:53]: ▸ /Users/vagrant/git/l10n-screenshots-dd/Logs/Test/Test-L10nSnapshotTests-2020.05.05_16-21-21-+0000.xcresult/Staging/1_Test/Diagnostics/L10nSnapshotTests-1C4ADD82-0C84-439F-9F2F-3CEB08BAE825/L10nSnapshotTests-70C0DB00-23B6-48C0-878A-7457D418E260/Session-L10nSnapshotTests-2020-05-05_162153-nADHQb.log
[16:21:53]: ▸ 2020-05-05 16:21:53.716 xcodebuild[4275:95115] [MT] IDETestOperationsObserverDebug: (00A41022-5B2C-4BE2-A649-1F6D91626F48) Beginning test session L10nSnapshotTests-00A41022-5B2C-4BE2-A649-1F6D91626F48 at 2020-05-05 16:21:53.716 with Xcode 11E503a on target <DVTiPhoneSimulator: 0x7f9284dc9b30> {
[16:21:53]: ▸ 		SimDevice: Clone 3 of iPhone 8 (34FCC14C-9675-4A15-B704-A186EFB89906, iOS 13.4, Shutdown)
[16:21:53]: ▸ } (13.4.1 (17E8260))
[16:22:21]: ▸ 2020-05-05 16:22:21.024 xcodebuild[4275:95115] [MT] IDETestOperationsObserverDebug: (00A41022-5B2C-4BE2-A649-1F6D91626F48) Finished requesting crash reports. Continuing with testing.
[16:22:22]: ▸ 2020-05-05 16:22:22.389 xcodebuild[4275:95115] [MT] IDETestOperationsObserverDebug: (47648418-8021-425D-BD13-C65E3DA2D979) Finished requesting crash reports. Continuing with testing.
[16:27:06]: ▸ 2020-05-05 16:27:06.769 xcodebuild[4275:95115] [MT] IDETestOperationsObserverDebug: 345.248 elapsed -- Testing started completed.
[16:27:06]: ▸ 2020-05-05 16:27:06.769 xcodebuild[4275:95115] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
[16:27:06]: ▸ 2020-05-05 16:27:06.769 xcodebuild[4275:95115] [MT] IDETestOperationsObserverDebug: 345.248 sec, +345.248 sec -- end
[16:27:11]: ▸ Test execute Succeeded
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-TranslationSettings-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-MenuOnTopSites-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-LocationBarContextMenu-01-no-url.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-TrackingProtectionStrictWarning-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-PasscodeSettings-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-PasscodeIntervalScreen-1.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-SearchSettings-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-MenuOnWebPage-03.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-TopSitesMenu-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-LoginsSettings-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-MenuOnWebPage-02.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-TrackingProtectionSettings-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-PanelsEmptyState-LibraryPanels.Bookmarks.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-WebViewContextMenu-02-image.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-SetPasscodeScreen-3.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-PrivateBrowsingTabsEmptyState-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Intro-2-Intro.Sync.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-MenuOnWebPage-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-OpenWithSettings-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-DisplaySettings-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-AddCustomSearchSettings-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-SetPasscodeScreen-1-nopasscode.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-PanelsEmptyState-LibraryPanels.SyncedTabs.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-TrackingProtectionEnabledPerSite-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-ClearPrivateDataSettings-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-SetPasscodeScreen-3-passcodesmustmatch.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-ContextMenuReloadButton-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-TrackingProtectionStrictMoreInfo-02.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-WebViewContextMenu-01-link.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-SetPasscodeScreen-2-typepasscode.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-ContextMenuReloadButton-02.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-NewTabSettings-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-ContextMenuReloadButton-03.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-TrackingProtectionBlockedElements-02.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-LocationBarContextMenu-02-with-url.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-HistoryTableContextMenu-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-URLBar-02.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-PanelsEmptyState-LibraryPanels.Downloads.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-TrackingProtectionDisabledPerSite-02.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-TrackingProtectionBlockedElements-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-URLBar-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-main-1.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-main-0.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-LongPressTextOptions-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Settings-main-2.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-LongPressTextOptions-02.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-BookmarksTableContextMenu-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-TrackingProtectionBasicMoreInfo-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-Intro-1-Intro.Welcome.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-DefaultTopSites-with-pocket-02.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-WebViewAuthenticationDialog-01.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-PanelsEmptyState-LibraryPanels.History.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-PanelsEmptyState-LibraryPanels.ReadingList.png'...
[16:27:19]: Copying '/Users/vagrant/git/l10n-screenshots/en-GB/en-GB/iPhone 8-DefaultTopSites-01.png'...
+----------+-------+
| snapshot results |
+----------+-------+
| Device   | en-GB |
+----------+-------+
| iPhone 8 |  💚   |
+----------+-------+

[16:27:19]: Generating HTML Report
[16:27:19]: Successfully created HTML file with an overview of all the screenshots: '/Users/vagrant/git/l10n-screenshots/en-GB/screenshots.html'
#######################################################################
# fastlane 2.146.1 is available. You are on 2.145.0.
# You should use the latest version.
# Please update using `sudo gem install fastlane`.
#######################################################################
# Run `sudo gem cleanup` from time to time to speed up fastlane
#######################################################################
+ echo 'Fastlane exited with code: 0'
Fastlane exited with code: 0
@JohanLorenzo JohanLorenzo added the Bug 🐞 This is a bug with existing functionality not behaving as expected label May 6, 2020
@isabelrios isabelrios added the eng:automation This is a task or bug affecting the automated tests label May 7, 2020
@isabelrios
Copy link
Contributor

isabelrios commented May 7, 2020

I'm not sure I understand @JohanLorenzo, the test suite finishes successfully [16:27:11]: ▸ Test execute Succeeded And I think all screenshots were successfully generated...
Editing since I saw the comments on bugzilla bug... I would need to take a deeper look, there is not enough info about the crashes/failures but when a screenshot is not taken, there is a test that failed I would say that for sure...
Using parallel testing is new, there might be crashes there depening on the environment where tests run

@JohanLorenzo
Copy link
Contributor Author

Okay! I agree, the logs give mixed signs, so maybe the crash is not related to the lack of screenshots.

I've got an idea when I chatted with @gueroJeff last Thursday. He told me the l10n team usually spot check screenshots once they're uploaded on Google Drive, because sometimes some are missing. I realized this check can easily be done by Taskcluster instead of a human. I can write a script that looks into the zip archives and ensure there are exactly X screenshots (X being 54 at the moment). If some pictures are missing, the script would bail out. This way, this new script would tell us if fastlane silently failed.

Moreover, the new script can fail with a specific error code and Taskcluster could automatically rerun the failed job. We probably need more data before doing so, thus I'll first make the task explicitly fail.

I'm tracking the work in bug 1636842

@JohanLorenzo
Copy link
Contributor Author

JohanLorenzo commented May 11, 2020

Repro rate: It happened on 31 locales out of 92.

Good news! I made a mistake last week. The number of failed locales is much lower: 11 out of 92. Moreover, fastlane does somehow report an error (which is ignored). Let me explain what I did.

I started to write the script I mentioned in my previous comment. I needed to re-download all archives (like I did in bug 1622800 comment 15). Then, I started to test out my script. I stumbled upon different results: en-GB turned out to be complete! I first thought there was a bug in my script, so I used unzip -l to list the content of the archive. It was indeed complete. I downloaded the en-GB archive again with Firefox => complete once again.

I don't know what I did wrong last time. Maybe extracting all 93 archives with MacOS' Finder wasn't a good idea and maybe it encountered a bug.

So, now I know only 11 locales failed and each of them is just missing a handful of them:

 * Archive "screenshots/ar.zip" does not contain the expected number of screenshots. Expected: 54. Got: 50
 * Archive "screenshots/bn.zip" does not contain the expected number of screenshots. Expected: 54. Got: 50
 * Archive "screenshots/fa.zip" does not contain the expected number of screenshots. Expected: 54. Got: 50
 * Archive "screenshots/hi-IN.zip" does not contain the expected number of screenshots. Expected: 54. Got: 53
 * Archive "screenshots/mr.zip" does not contain the expected number of screenshots. Expected: 54. Got: 50
 * Archive "screenshots/my.zip" does not contain the expected number of screenshots. Expected: 54. Got: 50
 * Archive "screenshots/ne-NP.zip" does not contain the expected number of screenshots. Expected: 54. Got: 50
 * Archive "screenshots/th.zip" does not contain the expected number of screenshots. Expected: 54. Got: 53
 * Archive "screenshots/uz.zip" does not contain the expected number of screenshots. Expected: 54. Got: 52
 * Archive "screenshots/zh-CN.zip" does not contain the expected number of screenshots. Expected: 54. Got: 53
 * Archive "screenshots/zh-TW.zip" does not contain the expected number of screenshots. Expected: 54. Got: 53

I looked into the ar logs. They do show a failure. Fastlane even calls out exit code 65 and shows a nice ❌ emoji. That said, fastlane keeps exiting with a 0 code.

Thus, writing an additional script is still a good idea, in my opinion. Debugging fastlane should be easier now that we have meaningful logs 🙂. I'm changing the title of this bug.

@JohanLorenzo JohanLorenzo changed the title fastlane silently fails when generating l10n screenshots fastlane notices error code when generating l10n screenshots but ignores it May 11, 2020
@isabelrios
Copy link
Contributor

To add a little bit of info about the missing screenshots...

Both failures are due to different options depending on the locale that are not being considered by the test. I'm working on a fix for those issues.

@JohanLorenzo
Copy link
Contributor Author

Excellent news: Thanks to @isabelrios great effort, the last run was entirely error-free!

We're now in a position where no locale fails. This doesn't address the original bug where fastlane keeps silently failing. That said, bug 1636842 introduced a new script that verifies what fastlane generated. Thus, I think we can close this issue. Don't hesitate to reopen it if fastlane is causing too much trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 This is a bug with existing functionality not behaving as expected eng:automation This is a task or bug affecting the automated tests
Projects
None yet
Development

No branches or pull requests

2 participants