Skip to content

Check for test_ keyword in repo path only on last directory#1812

Merged
sphuber merged 1 commit into
aiidateam:developfrom
sphuber:fix_1482_improve_repository_path_check_test_profiles
Jul 30, 2018
Merged

Check for test_ keyword in repo path only on last directory#1812
sphuber merged 1 commit into
aiidateam:developfrom
sphuber:fix_1482_improve_repository_path_check_test_profiles

Conversation

@sphuber
Copy link
Copy Markdown
Contributor

@sphuber sphuber commented Jul 28, 2018

Fixes #1482

The create_configuration function would check the repository path for the
test_ keyword and would raise if it was absent for a test profile or present
for a non-test profile. However, the check was performed on whether the prefix
was present in the entire path. This is too strict, as this would disallow any
path that even downstream would contain the string test_. Here, we change
the test to just check the last directory of the absolute path, which was the
intended behavior

@sphuber sphuber requested review from DropD and giovannipizzi July 28, 2018 14:41
@sphuber sphuber force-pushed the fix_1482_improve_repository_path_check_test_profiles branch from c62ffbc to b3c7afb Compare July 28, 2018 15:49
@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 28, 2018

Codecov Report

Merging #1812 into develop will not change coverage.
The diff coverage is 25%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1812   +/-   ##
========================================
  Coverage    66.58%   66.58%           
========================================
  Files          315      315           
  Lines        32368    32368           
========================================
  Hits         21553    21553           
  Misses       10815    10815
Impacted Files Coverage Δ
aiida/common/setup.py 74.63% <25%> (ø) ⬆️

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 b05318b...1fe16e4. Read the comment docs.

The `create_configuration` function would check the repository path for the
`test_` keyword and would raise if it was absent for a test profile or present
for a non-test profile. However, the check was performed on whether the prefix
was present in the entire path. This is too strict, as this would disallow any
path that even downstream would contain the string `test_`. Here, we change
the test to just check the last directory of the absolute path, which was the
intended behavior
@sphuber sphuber force-pushed the fix_1482_improve_repository_path_check_test_profiles branch from b3c7afb to 1fe16e4 Compare July 30, 2018 08:21
@sphuber sphuber requested a review from muhrin July 30, 2018 08:21
@sphuber sphuber merged commit eb5f6c5 into aiidateam:develop Jul 30, 2018
@sphuber sphuber deleted the fix_1482_improve_repository_path_check_test_profiles branch July 30, 2018 08:50
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.

Repository path check during setup for test prefix too restrictive

3 participants