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 support for environment variables #14

Open
wants to merge 3 commits into
base: release
Choose a base branch
from

Conversation

gf-atebbe
Copy link
Contributor

This pull request addresses the following two issues

utils.refresh_bootstrapper()
self.assertEqual(os.getenv('MANDREL_ROOT'), mandrel.bootstrap.ROOT_PATH)
expected = os.path.join(os.getenv('MANDREL_ROOT'), os.getenv('MANDREL_BOOTSTRAP_NAME'))
self.assertEqual(expected, mandrel.bootstrap.BOOTSTRAP_FILE)
Copy link
Owner

Choose a reason for hiding this comment

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

I'm happy to see tests, but this changes too much core stuff for a single test case to cover.

Given that you're introducing two changes (the mandrel root variable; the bootstrap basename variable), the cases to consider are considerably more complicated:

  • Base case: neither variable is defined (the original behaviors)
  • Root is specified, bootstrapper is not, Mandrel.py is present in specified root (should parse the file it finds)
  • Root is specified, bootstrapper is not, Mandrel.py is not present in specified root (should get basic defaults)
  • Root is specified, bootstrapper is specified, the specified file exists in the specified root
  • Root is specified, bootstrapper is specified, the specified file does not exist in the specified root
  • Root is not specified, bootstrapper is specified, the specified file exists; it should be used and the root should be where that guy was found. This would need testing at various file system levels.
  • Root is not specified, bootstrapper is specified, the specified file does not exist within the file system hierarchy; this should blow up, just like it does now if Mandrel.py can't be found.

So there's quite a few test cases that would need to be covered.

It's considerably simpler if only one of the issues is done: either specifying a root, or specifying a basename, but not both.

But as it stands, the test only covers the case where both are set, it doesn't treat them separately.

@gf-atebbe
Copy link
Contributor Author

@ethanrowe Apologies for the extremely slow turn-around on this. I added a bunch of tests to the PR to address the scenarios you outlined above.

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.

2 participants