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

add test for pgtest argument of TemporaryProfileManager #3486

Merged
merged 3 commits into from
Nov 12, 2019

Conversation

ltalirz
Copy link
Member

@ltalirz ltalirz commented Oct 30, 2019

this adds a test (running only on travis) for the pgtest argument of
the TemporaryProfileManager.

Furthermore, the pgtest argument is removed from internal functions of
the TemporaryProfileManager and treated as an instance variable instead.

this adds a test (running only on travis) for the `pgtest` argument of
the TemporaryProfileManager.

Furthermore, the `pgtest` argument is removed from internal functions of
the TemporaryProfilemanager and treated as an instance variable instead.
@ltalirz
Copy link
Member Author

ltalirz commented Oct 30, 2019

For reviewers: the new test is actually in test_test_manager.py (the old content of test_test_manager.py has been moved to test_profile_manager.py, since that is what it was actually testing).

Copy link
Contributor

@espenfl espenfl 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. Thanks @ltalirz. Just had one minor comment/question.

self.assertIsNone(self.profile_manager.root_dir)
self.assertIsNone(self.profile_manager.pg_cluster)
# pg_ctl is what PGTest also looks for (although it might be more clever)
pgtest = {'pg_ctl': which('pg_ctl')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should use the which from pgtest? And/or add another test that tests what we expect with which from AiiDA is the same that pgtest expects. There is a tight connection between AiiDA and pgtest now, but that might change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we should use the which from pgtest?

Since pgtest is a bit more clever than the standard "which", we could do that.
I'll make the change.

And/or add another test that tests what we expect with which from AiiDA is the same that pgtest expects.

I don't think that needs to be the case, and it's not what I'm testing here - I'm just trying to see of the TemporaryProfileManager works if I give it some valid path to pg_ctl (could be a different one than the one autodiscovered by pgtest).

Copy link
Member Author

@ltalirz ltalirz Oct 30, 2019

Choose a reason for hiding this comment

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

My main question for you was to check whether you are ok with me removing the pgtest argument from the internal functions of the TemporaryProfileManager (since I guess you were the main user) - I guess as long as the functionality is still accessible from the constructor, it is fine with you, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, absolutely. I was using it from the test_manager, which run the constructor I think, so for me this would work nicely.

@ltalirz
Copy link
Member Author

ltalirz commented Nov 8, 2019

This is ready for review

@ltalirz ltalirz requested a review from espenfl November 11, 2019 17:33
@ltalirz
Copy link
Member Author

ltalirz commented Nov 11, 2019

@espenfl Please have another look through this when you find the time. Cheers!

Copy link
Contributor

@espenfl espenfl left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks @ltalirz.

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @ltalirz

@sphuber sphuber merged commit 9ebdacd into aiidateam:develop Nov 12, 2019
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

3 participants