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

test_sys_checkout: use actual paths in on-the-fly configs rather than env var #194

Merged
merged 2 commits into from
Feb 23, 2023

Conversation

johnpaulalex
Copy link
Contributor

This will make it easier to test (in the near future) that checkout_externals actually checked out the desired repo dir.

The env-var path is still tested by two tests which rely on a checked-in externals.cfg that relies on this same environment variable (MANIC_TEST_BARE_REPO_ROOT)

More clearly document that env vars are passed to checkout_externals in the tests via os.environ, and that the command line assembled in _execute_checkout_in_dir is just for manual reproducibility.

User interface changes?: No

Fixes: None

Testing:
test removed: none
unit tests: none
system tests: 'make stest' passes
manual testing: none

… MANIC_TEST_BARE_REPO_ROOT env var. This will make it easier to test (in the near future) that checkout_externals actually checked out the desired repo dir.

The env-var path is still tested by two tests which rely on a checked-in externals.cfg that relies on an environment variable.

More clearly document that env vars are passed to checkout_externals via os.environ, and that the command line assembled in _execute_checkout_in_dir is just for manual reproducibility.
Copy link
Member

@billsacks billsacks left a comment

Choose a reason for hiding this comment

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

I like your removal of environment variables where they aren't needed!

I think it would be a bit better to keep the deletion of os.environ['MANIC_TEST_BARE_REPO_ROOT'] in the teardown function. The benefit of doing that is that the teardown function is called even if the test raises an exception and so bails early. Now I guess you'd need to do this conditionally, like:

if 'MANIC_TEST_BARE_REPO_ROOT' in os.environ:
    del os.environ['MANIC_TEST_BARE_REPO_ROOT']

But I don't feel this is critical if you prefer to leave things as they are.

…nt for easy tracking, and automatically tear it down after each test.
@johnpaulalex
Copy link
Contributor Author

sounds good, I added another commit to do this.

Copy link
Member

@billsacks billsacks 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!

@billsacks billsacks merged commit 71596bb into ESMCI:main Feb 23, 2023
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