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

Add an option to the test runner to exit immediately upon the first failure #22832

Closed
embray opened this issue Apr 19, 2017 · 17 comments
Closed

Comments

@embray
Copy link
Contributor

embray commented Apr 19, 2017

Inspired by the --exitfirst option to py.test, this adds a --exitfirst option to Sage's test runner to exit immediately upon the first test failure.

I've wanted something like this at several points, but one reason in particular is that part of the build of the patchbot Docker image is to perform the baseline test run, so that the image itself can be reused without having to rebuild the baseline each time. Obviously, if a test fails during the baseline test run then I want the Docker image build to fail immediately, and not wait until the rest of the test suite has run.

Component: doctest framework

Author: Erik Bray

Branch/Commit: c6a5b40

Reviewer: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/22832

@embray embray added this to the sage-8.0 milestone Apr 19, 2017
@embray
Copy link
Contributor Author

embray commented Apr 19, 2017

New commits:

c12a4d3Initial attempt to add a test runner option to stop a test run as soon as a single failure is encountered.
2f359e8Make --fail-once work with parallel doctests.

@embray
Copy link
Contributor Author

embray commented Apr 19, 2017

Commit: 2f359e8

@embray
Copy link
Contributor Author

embray commented Apr 19, 2017

Author: Erik Bray

@embray
Copy link
Contributor Author

embray commented Apr 19, 2017

Branch: u/embray/tests/fail-once

@jdemeyer
Copy link

Replying to @embray:

Inspired by the --exitfirst option to py.test, this adds a --fail-once option to Sage's test runner to exit immediately upon the first test failure.

Obvious question: why not call the Sage option exitfirst? I find it a better name than fail-once.

@jdemeyer
Copy link

comment:3

I'm making some changes, hang on...

@jdemeyer
Copy link

Changed branch from u/embray/tests/fail-once to u/jdemeyer/tests/fail-once

@jdemeyer
Copy link

Changed commit from 2f359e8 to c2bff84

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

New commits:

f26f64eInitial attempt to add a test runner option to stop a test run as soon as a single failure is encountered.
2e9a80cMake --fail-once work with parallel doctests.
c2bff84Rename --fail-once to --exitfirst; minor fixes; add test

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@embray
Copy link
Contributor Author

embray commented Apr 20, 2017

comment:6

I'm fine with that, thanks.

@embray
Copy link
Contributor Author

embray commented Apr 20, 2017

comment:7

Replying to @jdemeyer:

Replying to @embray:

Inspired by the --exitfirst option to py.test, this adds a --fail-once option to Sage's test runner to exit immediately upon the first test failure.

Obvious question: why not call the Sage option exitfirst? I find it a better name than fail-once.

I personally find "fail once" to be clearer than "exit first"--"Exit first what?" is what it makes me ask. That said, the documentation makes it clear enough, and I don't mind the consistency.

@embray
Copy link
Contributor Author

embray commented Apr 20, 2017

comment:8

Oops, one little nitpick--you forgot to remove the line fail_immediately=False after renaming it to abort_now everywhere else.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 20, 2017

Changed commit from c2bff84 to c6a5b40

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 20, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

c6a5b40Remove forgotten line

@vbraun
Copy link
Member

vbraun commented Apr 23, 2017

Changed branch from u/jdemeyer/tests/fail-once to c6a5b40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants