Repository navigation
Conversation
|
👍 Though really those tests should just use a smaller number of coordinates, probably with some thought about them being near poles, etc. Anyway, I think even just marking those tests will be useful incentive to try to speed them up! |
|
cc @eteq |
|
Thank goodness! And yeah, I think maybe the coordinates accuracy test could be broken up between a minimal subset, and running the full suite which would be more necessary when testing changes that directly affects the coordinates module. |
|
👍 from me on this, at least in some form. @embray's idea is in principal a good idea, but it's not really clear how that "minimal subset" would work - the accuracy tests are very simple, and just use a reference file of the "right answer". Perhaps the key is to have a "slow" version that runs them all, and a "fast" version that just does the first few coordinate sets tests instead of all 200-or-so per system ? @cdeil - feel free to take a shot at that, or just flagging them all "slow" and we can break out faster ones later or something. |
|
That was exactly what I had in mind. |
|
Of course, we could just speed up astropy.coordinates 😀 Anyway, I agree that we can probably reduce the number of tests to 20 for the regular tests, and do the rest only with some kind of |
|
As an aside: Any idea why the |
|
That is really weird. Is it reproducible or was it just a glitch? |
|
I've added the slow test option and changed the slow coordinate tests. By default the tests now run a minute faster: But the full accuracy tests are still available if you use the `--slow`` option: |
--tests --runslow option and mark coordinates precision tests as slow|
@embray @mdboom Yes, the Here's the new top top slowest Astropy tests on my Macbook: Note that there are quite a few parametrized tests where each parameter set is counted as a separate test and thus don't show up with the pytest |
|
Can someone please review this? |
|
👏 |
There was a problem hiding this comment.
Maybe rename this file to test_skip.py?
|
The FITS tests that are slow for you are pretty I/O intensive. That could be a bottleneck on your machine. |
|
I've made a new issue #2345 for the slow FITS unit tests on Mac. Any other suggestions for this PR? |
|
@cdeil - the APE5 changes are going to conflict with this quite a bit, unfortunately, because it's a fairly drastic change of how these accuracy tests are actually invoked... so I think we should wait until that gets in to finalize this (but because this is already in as a PR, it's fine to do that after the official feature freeze). If it helps, the APE5 branch also now runs only a subset of the accuracy tests, so it's about 10x faster. But that could be changed once this is combined in. |
|
(And if you want to see what I mean about the changes, you can take a look at https://github.com/eteq/astropy/tree/coordinates-ape5 ) |
|
This is now in #2422 - the accuracy tests are dramatically sped up by just only running a fraction of them at a time. |
|
Is this still needed? Now that the coordinate tests are faster I'd actually vote that we don't include it, just to keep some kind of limit on the number of options we are adding (feature creep). One usually never has to really run the whole test suite anyway, since we can use the |
|
The use case I have for it is to run "integration tests" for Gammapy, i.e. small analysis chains that process a test dataset and produce some high-level analysis result. Using the normal testing setup for that is convenient, because really all that's different about these tests compared to unit tests is that they are slow and don't need to run for every commit on travis-ci. |
|
@cdeil - ok, in that case do you want to go ahead and rebase this? Also, note that the changes to the |
|
I'd still be fine with including this if you want to rebase it (or I can, and manually merge). I think the changelog entry just needs to be moved. |
|
Postponing for now... |
|
@aphearin asked for this feature again on There were some concerns if this is useful enough to be included, and this got sidetracked a bit by discussions on performance issues in Astropy. |
|
I'll follow this thread in the coming days in case there is some hangup. In case this can continues to get kicked down the road in astropy_helpers, it's no sweat, I'd just want to know how to make the necessary modifications within my own package (since my simple decorator solution failed). But of course if it gets implemented within the helpers, from my perspective that is ideal. Either way, thanks for the help @cdeil |
|
I didn't realize there was any objection to this. I think it's useful to have. |
|
As for astropy-helpers maybe leave it alone. This is good incentive for me to rework how options are added to the |
@embray Great! Please mention it here when you file an issue for astropy-helpers or make a PR. |
|
Yeah, I'll try to get that cleaned up today. It's long overdue. |
|
I think this mostly just depends on me finishing #4020. I think there's more work left for me to do there but I got sidetracked. |
|
No, and #4020 was only for Astropy 1.1 too. But I'd be happy to try to get this integrated for 1.1... |
|
Just a thought - if this goes ahead, the option should be either |
|
Just for the record, as I pointed out to @aphearin it's super easy to add one's own custom markers with py.test https://pytest.org/latest/example/markers.html One can then use the Or even more simply using the recipe this PR was originally based on: http://pytest.org/latest/example/simple.html?highlight=mark%20slow#control-skipping-of-tests-according-to-command-line-option This version also makes it so that the "slow" tests are skipped by default. There's no reason py.test recipes like this can't be used with the astropy test runner (if it doesn't work for some reason that's probably a bug on our end). The only reason for this PR is to add an argument to the test runner to make it more convenient to enable slow tests (which I'm fine with doing, now that it's easier to keep the test runner and then |
|
I'm closing this old PR. @embray points out how to achieve the same thing directly with On my machine, currently with Astropy master the tests run for 228.88 seconds and these are the slowest: Probably the Astropy tests could be made faster, my experience is that people very often choose test datasets that could be smaller and still test the exact same thing. |
Some of the Astropy tests take > 10 seconds to execute and in my opinion should be skipped by default.
Specifically the tests in
astropy/coordinates/tests/accuracyaren't really unit tests that need to be run all the time by every developer.Here's the 10 slowest tests I find on my Macbook via
And for a Linux server I find these 10 tests to be the slowest:
I found this documented method to add a --runslow option for
py.test.I'm not familar with the Astropy test runner, but it shouldn't be hard, so I'll try to put it in and add
pytest.mark.slowto theastropy/coordinates/tests/accuracytests.