Closed Bug 1344263 Opened 9 years ago Closed 8 years ago

The autoland.webapi.test task isn't respecting the --keep flag

Categories

(Conduit :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: mars, Assigned: mars)

Details

Attachments

(1 file)

The 'invoke autoland.webapi.test' task doesn't respect the --keep flag. That's causing non-fatal errors and output noise on CircleCI. See the 'Test' step on https://circleci.com/gh/mozilla-conduit/conduit/40
Comment on attachment 8843357 [details] autoland: fix the autoland.test.webapi --keep flag (bug 1344263) https://reviewboard.mozilla.org/r/117120/#review119616 ::: commit-message-aa672:3 (Diff revision 1) > + autoland: fix the autoland.test.webapi --keep flag (bug 1344263) r?smacleod > + > + It turns out you can not pass variables between invoke tasks via the ctx.config object. This patch moves the container cleanup logic into the test task instead of passing context data around between tasks. The container cleanup logic is wrapped in a try/finally so that it runs even if there is a test suite error or other non-zero exit status. You should manually wrap these at around 72 characters. ::: tasks.py:24 (Diff revision 1) > - ctx.config.keep_containers = keep # Stashed for our cleanup tasks > - run( > - 'docker-compose' > + cmd = 'docker-compose' \ > + ' -f {project_root}/autoland/docker-compose.yml' \ > + ' -p {test_project_name}' \ using \ for line continuations is frowned upon for pep8, please use parenthesis for the implicit string continuation on next line. ::: tasks.py:27 (Diff revision 1) > - ''.format( > + ''.format( > project_root=project_root, > - test_project_name=project_test_name, > - args=testargs, > + test_project_name=project_test_name > + ) this doesn't look style compliant, are you running format? ::: tasks.py:41 (Diff revision 1) > + finally: > + # Clean up the containers > + if not keep: > + ctx.run(cmd + ' stop', pty=True, echo=True) > + ctx.run(cmd + ' rm --force -v', pty=True, echo=True) What is the exit code of this invoke task now when the tests fail? will it remain non zero (this is important for CI test failures)
Attachment #8843357 - Flags: review?(smacleod) → review-
Outdated, no longer needed in favor of Lando.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: