Repository navigation
Conversation
…on, and document how to write tests that need a lot of resources
|
Would any of the weekly crons be using the |
dhomeier
left a comment
There was a problem hiding this comment.
Thanks, this looks very useful. Apart from the stylistic and usage notes, good to go in once the readthedocs failure is fixed.
| Tests that have large disk and/or memory requirements | ||
| ==================================== |
There was a problem hiding this comment.
| Tests that have large disk and/or memory requirements | |
| ==================================== | |
| Tests that have large disk and/or memory requirements | |
| ===================================================== |
Sphinx warning/readthedocs failure
| @pytest.mark.skipif(not os.getenv('TEST_INTENSIVE'), | ||
| reason='Environment variable TEST_INTENSIVE must be ' | ||
| 'defined to run this test') |
There was a problem hiding this comment.
| @pytest.mark.skipif(not os.getenv('TEST_INTENSIVE'), | |
| reason='Environment variable TEST_INTENSIVE must be ' | |
| 'defined to run this test') | |
| @pytest.mark.skipif(os.getenv('TEST_INTENSIVE', 0) == 0, | |
| reason='Environment variable TEST_INTENSIVE must be defined to run this test') |
Just found that I intuitively expected the env var set to 0 to disable the tests; this would also be more consistent with how we are using the ASTROPY_USE_ vars (also noticed that setup is using os.environ.get(), whatever the correct Zen is here ;-).
I prefer it without further linebreak, but unfortunately this would make the docs example break the line...
There was a problem hiding this comment.
I don't think we have any consistent zen in this department:
astropy/.github/workflows/ci_workflows.yml
Lines 11 to 13 in 73c57e1
I would have named it SHOW_ME_THE_MONEY but this works too.
There was a problem hiding this comment.
But those are checking the value as well.
TEST_INTENSIVE="False" or TEST_INTENSIVE=0 did let the tests run.
There was a problem hiding this comment.
Re: values -- Yes, I agree with @dhomeier . The check should be more strict to only let it run when the value is 1, as documented.
There was a problem hiding this comment.
I'd be willing to allow anything that could be interpreted as True, but in fact my suggestion will still accept 'false' as well...
|
|
||
| @pytest.mark.skipif(not os.getenv('TEST_READ_HUGE_FILE'), | ||
| reason='Environment variable TEST_READ_HUGE_FILE must be ' | ||
| @pytest.mark.skipif(not os.getenv('TEST_INTENSIVE'), |
There was a problem hiding this comment.
| @pytest.mark.skipif(not os.getenv('TEST_INTENSIVE'), | |
| @pytest.mark.skipif(os.getenv('TEST_INTENSIVE', 0) == 0, |
|
Not sure about the changelog – do we generally include them for functionality only visible to developers? |
No, the GitHub actions workers don't have enough RAM |
|
Marked this as OK when readthedocs is fixed, but I think with @pllim there are at least 2 votes for checking |
No opinion here one way or the other. |
|
I think just checking if an environment variable is set or unset is enough, the value doesn't matter and having a complex condition in every test isn't ideal. |
|
+1 for markers, that's definitely the pytest tool for this job. |
|
I don't have much time to work on this so happy for someone to take the lead on pytest markers (and we can then close this PR) |
|
This looks very useful. I've been looking for something like this for the new cosmology test suite. |
Ideally, the pytest marker would be upstream from |
|
Closing in favor of #12764 . Thanks anyway! |
Description
This renames the environment variable for the big table tests to be more general and usable by other tests, and adds a tox option to more easily run these tests without setting an environment variable.
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel.no-changelog-entry-neededlabel. If this is a manual backport, use theskip-changelog-checkslabel unless special changelog handling is necessary.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.