Hi folks. I have a build with a test that I’ve deliberately broken. Although the UI correctly reports the build as failed, the text and the favicon are green. Any ideas why?
Setting errexit
in the main shell messes up the build control logic.
Don’t set errexit in the main shell. This shell also runs the build’s internal logic and the sudden exit terminates it abnormally.
If a failing command should terminate the build, put it into a section other than script: – i.e. install. The script: section is designed to run tests – i.e. stuff that you want to run to completion even if something fails.
Without set -e
, I see apparently inconsistent behavior:
https://travis-ci.org/github/sky-map-team/stardroid/builds/738844948 shows as green (incorrectly) but
https://travis-ci.org/github/sky-map-team/stardroid/jobs/738844949 shows red (as expected).
AFAICT these two things reference the same github commit.
The last lines look suspicious
Done. Your build exited with 1.
emulator: Saving state on exit with session uptime 525266 ms
I believe you need to stop the emulator in after_script:
– it exiting successfully after the job’s exit proper may be what’s skewing the build’s status.
Your only job is allowed to fail. The job fails, but the build succeeds.
# (see "sdkmanager --list --verbose| grep ^system-images" for full list)
# See https://github.com/mmcc007/test_emulators for many more options.
jobs:
- API=29 ABI=x86_64 GOO=google_apis_playstore
jobs:
fast_finish: true
# jobs that are flakey or fail consistently
allow_failures:
- env: API=29 ABI=x86_64 GOO=google_apis_playstore # flutter driver: "No devices found."
- env: API=29 ABI=x86 GOO=google_apis_playstore # flutter doctor: device offline
- env: API=29 ABI=x86_64 GOO=google_apis # flutter drive: "Bad state: No element"
- env: API=29 ABI=x86 GOO=google_apis # DriverError: Failed to fulfill GetHealth due to remote error
- env: API=29 ABI=x86_64 GOO=default # hangs while resolving gradle dependencies, etc...
- env: API=29 ABI=x86 GOO=default # hangs while resolving dependencies
- env: API=28 ABI=x86_64 GOO=google_apis_playstore # flutter driver hangs
- env: API=28 ABI=x86 GOO=google_apis_playstore # flutter driver hangs
- env: API=28 ABI=x86 GOO=google_apis # DriverError: Failed to fulfill GetHealth due to remote error
2 Likes
Doh. Yes, that is it. The perils of cargo-culting someone else’s configuration!
Thanks for your help.