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

DM-34377: Add postgres testing for butler (including datastore) #676

Merged
merged 3 commits into from Apr 8, 2022

Conversation

timj
Copy link
Member

@timj timj commented Apr 8, 2022

This will hopefully catch the problem fixed by #675. We do not run postgres tests on Jenkins but we do run them in github actions. This test does fail if #675 is not applied.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

timj added 2 commits April 8, 2022 10:44
isort was confused by the try/except import blocks above.
@timj timj requested a review from andy-slac April 8, 2022 17:57
This will ensure that datastore is tested with postgres.
@codecov
Copy link

codecov bot commented Apr 8, 2022

Codecov Report

Merging #676 (2f7c96a) into main (43ed8f7) will increase coverage by 0.03%.
The diff coverage is 94.00%.

@@            Coverage Diff             @@
##             main     #676      +/-   ##
==========================================
+ Coverage   84.26%   84.29%   +0.03%     
==========================================
  Files         242      242              
  Lines       30971    31019      +48     
  Branches     5217     5219       +2     
==========================================
+ Hits        26097    26149      +52     
+ Misses       3707     3706       -1     
+ Partials     1167     1164       -3     
Impacted Files Coverage Δ
tests/test_butler.py 97.55% <94.00%> (-0.17%) ⬇️
python/lsst/daf/butler/_butler.py 81.33% <0.00%> (+0.31%) ⬆️
...n/lsst/daf/butler/registry/interfaces/_database.py 87.53% <0.00%> (+0.49%) ⬆️
...n/lsst/daf/butler/registry/databases/postgresql.py 78.86% <0.00%> (+1.03%) ⬆️
python/lsst/daf/butler/tests/utils.py 94.04% <0.00%> (+1.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43ed8f7...2f7c96a. Read the comment docs.

Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Looks good. General comment - the server setup logic repeats some of the test_postgresql.py, would it be worth to move it to a common base class?

@timj
Copy link
Member Author

timj commented Apr 8, 2022

test_postgresql.py does the setup a slightly different way. I tried using that way but the tests got a bit upset. I therefore switched to the caching scheme recommended in the testing.postgresql docs. I also tried switching test_postgresql.py over to that approach but it took 10% longer to run the tests that way. If we don't mind that slowdown I can move the setUp/teadDown[class] code to a helper class.

@andy-slac
Copy link
Contributor

Is it 10% for test_postgresql.py or the whole test? I'm OK with leaving it as it is now, and let the next person who also needs postgres to refactor it.

@timj
Copy link
Member Author

timj commented Apr 8, 2022

The entire run of test_postgresql.py went from 60 seconds to 70 seconds when I used the postgre cache factory thing.

@timj timj merged commit 6ac0126 into main Apr 8, 2022
@timj timj deleted the tickets/DM-34377 branch April 8, 2022 20:29
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.

None yet

2 participants