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

Ensure ignored tests are picked up by tox #2758

Merged
merged 2 commits into from
Aug 13, 2019
Merged

Conversation

lnsndn
Copy link
Contributor

@lnsndn lnsndn commented Aug 10, 2019

This fixes #2757, see full description of motivation there.

The change modifies file permissions on range_test.py and sge_test.py from 755 to 644 so that they are actually picked up by tox. This revealed a bunch of failing tests that I also fixed. In some cases because the tests were wrong, in other cases because of actual problems in the luigi functionality. The commit messages contain detailed explanations of the changes.

The change has been tested by running the concerned files manually with python -m unittest <module>, and also by running the full tox test suite on my machine, verifying that 1) the tests are picked up, 2) they go through, 3) no other tests are impacted.

Would like @lallea to review the parts concerning MonthInstantiationTest.

lnsndn added 2 commits August 10, 2019 08:34
Tox has not been running range_test.py due to the file being executable. This commit sets the file permissions to read/write only and remediates the problems that arose when the tests ran again:

* Some tests for RangeMonthly were not accurately capturing the correct logic
* Some tests were not compatible with Python 3 in some map operations
* RangeByMinutesBase performed arithmetics that yield different results on Python 2 and 3, this was changed to be more resilient on both. May have impact on those relying on the erroneous behavior right now.
Tox has not been running contrib/sge_test.py due to the file being executable. This commit sets the file permissions to read/write only and remediates the problems that arose when the tests ran again:

* pickle.dump() behaves differently in Python 2 and 3, ensure that it works for both
* Get rid of warnings about unclosed files, handling file lifecycles properly
* Minor docstring syntax
@lallea
Copy link
Contributor

lallea commented Aug 10, 2019

The changes to MonthInstantiationTest all look fine. Thx @lnsndn!

For context: The changed tests were passing before #2666 got merged, which corrected the confused RangeMonthly implementation. Before this PR, the tests validated the old, confused behaviour.

@lnsndn
Copy link
Contributor Author

lnsndn commented Aug 11, 2019

Seems like the codecov/patch step fails because I changed some file handling operations. I noticed the way files were handled wasn't safe (they were opened but not closed) so I added functionality for closing them while I was making the tests work in the same code parts. Now codecov is complaining I didn't add a test for it. Is this vital to fix?

Or is the problem due to something else?

Copy link
Collaborator

@dlstadther dlstadther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me.

Don't worry about that top codecov test

@lnsndn
Copy link
Contributor Author

lnsndn commented Aug 13, 2019

Thank you @dlstadther. How do I get it merged?

@dlstadther dlstadther merged commit 53d4361 into spotify:master Aug 13, 2019
@dlstadther
Copy link
Collaborator

Thanks for your contribution @lnsndn ! (And thanks @lallea for your review and context!)

GoodDok pushed a commit to GoodDok/luigi that referenced this pull request Aug 23, 2019
* Enable erroneously skipped range tests

Tox has not been running range_test.py due to the file being executable. This commit sets the file permissions to read/write only and remediates the problems that arose when the tests ran again:

* Some tests for RangeMonthly were not accurately capturing the correct logic
* Some tests were not compatible with Python 3 in some map operations
* RangeByMinutesBase performed arithmetics that yield different results on Python 2 and 3, this was changed to be more resilient on both. May have impact on those relying on the erroneous behavior right now.

* Enable erroneously skipped SGE tests

Tox has not been running contrib/sge_test.py due to the file being executable. This commit sets the file permissions to read/write only and remediates the problems that arose when the tests ran again:

* pickle.dump() behaves differently in Python 2 and 3, ensure that it works for both
* Get rid of warnings about unclosed files, handling file lifecycles properly
* Minor docstring syntax
GoodDok pushed a commit to GoodDok/luigi that referenced this pull request Aug 23, 2019
* Enable erroneously skipped range tests

Tox has not been running range_test.py due to the file being executable. This commit sets the file permissions to read/write only and remediates the problems that arose when the tests ran again:

* Some tests for RangeMonthly were not accurately capturing the correct logic
* Some tests were not compatible with Python 3 in some map operations
* RangeByMinutesBase performed arithmetics that yield different results on Python 2 and 3, this was changed to be more resilient on both. May have impact on those relying on the erroneous behavior right now.

* Enable erroneously skipped SGE tests

Tox has not been running contrib/sge_test.py due to the file being executable. This commit sets the file permissions to read/write only and remediates the problems that arose when the tests ran again:

* pickle.dump() behaves differently in Python 2 and 3, ensure that it works for both
* Get rid of warnings about unclosed files, handling file lifecycles properly
* Minor docstring syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

range_test and sge_test not picked up by tox due to being executable
3 participants