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

Fix environment variable loading only working with 4 characters #9

Merged
merged 1 commit into from
Nov 3, 2019

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Nov 1, 2019

There was a hardcoded [5:] indexing done on environment variable names that works for any package name that is 4 letters long (ex. DASK). If the package name was longer than that then donfig wouldn't find the environment variable or rather it would assign the wrong value by not cutting enough of the prefix away.

This issue wasn't caught before because all my tests used a test config name of "test" (4 characters).

@djhoese djhoese self-assigned this Nov 1, 2019
@djhoese djhoese added the bug Something isn't working label Nov 1, 2019
@coveralls
Copy link

coveralls commented Nov 1, 2019

Pull Request Test Coverage Report for Build 42

  • 29 of 29 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 94.251%

Totals Coverage Status
Change from base Build 41: 0.02%
Covered Lines: 1082
Relevant Lines: 1148

💛 - Coveralls

@codecov
Copy link

codecov bot commented Nov 1, 2019

Codecov Report

Merging #9 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #9      +/-   ##
==========================================
+ Coverage   94.23%   94.25%   +0.02%     
==========================================
  Files           4        4              
  Lines         572      574       +2     
==========================================
+ Hits          539      541       +2     
  Misses         33       33
Impacted Files Coverage Δ
donfig/config_obj.py 90.98% <100%> (+0.03%) ⬆️
donfig/tests/test_config.py 98.96% <100%> (ø) ⬆️

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 ec2ce6c...d51a072. Read the comment docs.

@djhoese djhoese merged commit 1dd3bff into pytroll:master Nov 3, 2019
@djhoese djhoese deleted the bugfix-env-prefix branch November 3, 2019 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants