Skip to content

Added a --repeat option for testing - #3019

Merged
astrofrog merged 2 commits into
astropy:masterfrom
astrofrog:repeat-option
Oct 30, 2014
Merged

astrofrog merged 2 commits into
astropy:masterfrom
astrofrog:repeat-option

Conversation

@astrofrog

Copy link
Copy Markdown
Member

In some cases, we need to debug non-determininstic failures, and for this it can be handy to have a --repeat option. For example, for #2964 the failures only happen 10% of the time, so having this kind of option makes it easy to run the test say 100 times to determine how often it fails (and to force it to fail). This can also be useful for pre-empting issues like #3018 - there may be issues that only become apparent once we have enough tests. This change will need a corresponding change in astropy-helpers to add the option to python setup.py test but in the mean time it works with py.test --repeat=10 for example. I'll do a PR for astropy-helpers if there is support for this PR.

@astrofrog

Copy link
Copy Markdown
Member Author

Will also be handy for debugging the random SAMP failures.

@embray

embray commented Oct 6, 2014

Copy link
Copy Markdown
Member

I'm definitely +1 on the feature. Though I'm not sure this PR fully addresses all the changes needed to make a new test option work.

I've been planning to refactor how we add test options so that it can be all in one place, rather than in like 3 or 4 different places like it is currently :(

@embray

embray commented Oct 6, 2014

Copy link
Copy Markdown
Member

Ah, I see you acknowledged that in the text of your PR :)

@astrofrog

Copy link
Copy Markdown
Member Author

@embray - I've finalized this PR and have opened astropy/astropy-helpers#92 - can you give it a final review?

@eteq

eteq commented Oct 17, 2014

Copy link
Copy Markdown
Member

@astrofrog - one question on this - presumably it would take a long time to actually run all of python setup.py test --repeat=100. So is the intent to instead do things like python setup.py test --repeat=100 --args="-k test_a_single_thing"?

@astrofrog

Copy link
Copy Markdown
Member Author

@eteq - yes the intent is you would actually use this with only specific tests or packages (with the -P option)

@eteq

eteq commented Oct 17, 2014

Copy link
Copy Markdown
Member

Gotcha. 👍 from me, then.

@astrofrog

Copy link
Copy Markdown
Member Author

I'm going to wait a bit for this because I was to get astropy-helpers 0.4.3 out and this isn't urgent.

@astrofrog astrofrog added this to the v0.4.3 milestone Oct 30, 2014
@astrofrog

Copy link
Copy Markdown
Member Author

This has been working smoothly (along with astropy/astropy-helpers#92) so I'm going to go ahead and merge.

astrofrog added a commit that referenced this pull request Oct 30, 2014
Added a --repeat option for testing
@astrofrog
astrofrog merged commit 93530e4 into astropy:master Oct 30, 2014
@embray

embray commented Dec 30, 2014

Copy link
Copy Markdown
Member

I have one concern about this now that I look at it again, which is that if an affiliated package has a test(...) function that is not kept up to date, if they use an astropy-helpers release with this update their ./setup.py test command will break (yet another reason I need to completely redo how the test runner is handled, something I've mentioned elsewhere before...

I'll think about if I can find a decent workaround to this.

astrofrog added a commit that referenced this pull request Dec 31, 2014
Added a --repeat option for testing
embray added a commit to embray/astropy_helpers that referenced this pull request Dec 31, 2014
… it actually takes.

This provides at least a temporary workaround to the issue I raised in
this comment:

astropy/astropy#3019 (comment)

(It would be nicer if we also warned when unsupported options were
passed to the test command, but that would require a little more
reworking of this--this is good enough to at least ensure a degree of
compatibility.)
@embray

embray commented Dec 31, 2014

Copy link
Copy Markdown
Member

I added a temporary workaround to this issue in astropy/astropy-helpers@1068e26; will come up with something better another time.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants