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

Exclude explores #172

Merged
merged 15 commits into from
Apr 2, 2020
Merged

Exclude explores #172

merged 15 commits into from
Apr 2, 2020

Conversation

DylanBaker
Copy link
Collaborator

No description provided.

@DylanBaker DylanBaker requested a review from joshtemple as a code owner March 29, 2020 15:07
@codecov
Copy link

codecov bot commented Mar 29, 2020

Codecov Report

Merging #172 into master will increase coverage by 0.44%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
+ Coverage   69.81%   70.26%   +0.44%     
==========================================
  Files          10       10              
  Lines         795      807      +12     
==========================================
+ Hits          555      567      +12     
  Misses        240      240              
Impacted Files Coverage Δ
spectacles/client.py 71.73% <ø> (ø)
spectacles/runner.py 54.54% <0.00%> (ø)
spectacles/cli.py 69.50% <100.00%> (+0.21%) ⬆️
spectacles/validators.py 62.02% <100.00%> (+1.84%) ⬆️

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 ac4aafc...82c3fee. Read the comment docs.

@DylanBaker
Copy link
Collaborator Author

@joshtemple I think I made a bit of a meal of rebasing that, somehow, but this should now be good.

spectacles/cli.py Outdated Show resolved Hide resolved
Comment on lines +202 to +210
excluded_explores = {}
for model in excluded_models:
# Expand wildcard operator to include all specified or discovered explores
excluded_explore_names = exclusion[model.name]
if "*" in excluded_explore_names:
excluded_explore_names.remove("*")
excluded_explore_names.update(
set(explore.name for explore in model.explores)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If there's a situation with model_A.explore_A and model_B.explore_A, and the --exclude argument is model_A.explore_A, would this still preserve explore_A in model_B? Any way we can add this case to the unit tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It will still preserve it. The explores to exclude are stored in lists against a key of the model name. We then only check against the explores within a given model: https://github.com/spectacles-ci/spectacles/pull/172/files#diff-cbee2ab0268f8f001868af4ca066ba04R228-R232

I'll definitely add some tests to confirm that though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@joshtemple I've confirmed this is the case and have added an additional test test_build_project_one_ambiguous_explore_excluded to verify so.

I also actually re-factored some of the other tests to make the selection easier.

@DylanBaker DylanBaker merged commit e7b2108 into master Apr 2, 2020
@DylanBaker DylanBaker deleted the feature/exclude branch April 2, 2020 12:34
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