-
Notifications
You must be signed in to change notification settings - Fork 1.8k
scorecard - Add list flag #2137
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
Merged
jmccormick2001
merged 7 commits into
operator-framework:master
from
jmccormick2001:add-list-flag
Nov 4, 2019
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b3812d9
add initial list flag logic to scorecard
21142ea
fix the list flag - v1alpha1 check
f044446
refactor text output and list flag logic
afa717d
clean up code, add quotes around labels
7313800
slight refactor of applying selectors when listing
2c5604f
add test for label and selector flags for scorecard
d1e510f
change test selector to use suite=basic
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,14 +20,34 @@ operator-sdk scorecard --version v1alpha2 --config "$CONFIG_PATH" |& grep '^.*er | |
|
||
# test to see if v1alpha2 is used from the command line | ||
commandoutput="$(operator-sdk scorecard --version v1alpha2 --config "$CONFIG_PATH_V1ALPHA2" 2>&1)" | ||
failCount=`echo $commandoutput | grep -o ": fail" | wc -l` | ||
failCount=`echo $commandoutput | grep -o "fail" | wc -l` | ||
expectedFailCount=3 | ||
if [ $failCount -ne $expectedFailCount ] | ||
then | ||
echo "expected fail count $expectedFailCount, got $failCount" | ||
exit 1 | ||
fi | ||
|
||
# test to see if list flag work | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🥇 Great |
||
commandoutput="$(operator-sdk scorecard --version v1alpha2 --list --selector=suite=basic --config "$CONFIG_PATH_V1ALPHA2" 2>&1)" | ||
labelCount=`echo $commandoutput | grep -o "Label" | wc -l` | ||
expectedLabelCount=3 | ||
if [ $labelCount -ne $expectedLabelCount ] | ||
then | ||
echo "expected label count $expectedLabelCount, got $labelCount" | ||
exit 1 | ||
fi | ||
|
||
# test to see if selector flags work | ||
commandoutput="$(operator-sdk scorecard --version v1alpha2 --selector=suite=basic --config "$CONFIG_PATH_V1ALPHA2" 2>&1)" | ||
labelCount=`echo $commandoutput | grep -o "Label" | wc -l` | ||
expectedLabelCount=3 | ||
if [ $labelCount -ne $expectedLabelCount ] | ||
then | ||
echo "expected label count $expectedLabelCount, got $labelCount" | ||
exit 1 | ||
fi | ||
|
||
# test to see if version in config file allows v1alpha1 to be specified | ||
commandoutput="$(operator-sdk scorecard --config "$CONFIG_PATH_V1ALPHA1" 2>&1)" | ||
echo $commandoutput | grep "Total Score: 67%" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jmccormick2001,
I could not find any test here with --selector -l (passing the selector) and checking that just the tests with the label X was executed as I could not find the test with the --list / -l as well. Should we not add it here?
Besides this, all shows OK for me /LGTM