-
Notifications
You must be signed in to change notification settings - Fork 684
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
Document where test scenarios are located #4654
Document where test scenarios are located #4654
Conversation
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.
Very useful function.
Please, also add a oneliner for usage
Hello @jan-cerny! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
Improve the tests/README.md to document where test scenarios are located and suggests the users to use a bash function to quickly find the test scenarios for a given rule.
Because function find_tests is expected to return a path I have changed the name of the function. Also improves wording and adds an explanation of usage of the aforementioned function.
f3ee95e
to
a7e71bc
Compare
@yuumasato I have rephrased |
@yuumasato Updated |
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.
I still pitch that a function that prints you the paths for where to find the test scenarios for a rule would be more convenient.
Stretchy goal: a function that creates the directories necessary to test a new rule! (creating these directories is a pain). This will be useful until the tests/data
directory is migrated.
tests/README.md
Outdated
rule_id="$1" | ||
ssg_root="/path/to/your/content/git/repository" | ||
tests_dir=$(find $ssg_root/tests/data/ -name *$rule_id*) | ||
[ -n "$tests_dir" ] && cd $tests_dir |
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.
If find
returns no files, nothing is done, and no message is output.
user: "What happened?"
@yuumasato I changed the function to find test scenarios folder and print path instead of trying |
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.
@mildas Some more changes.
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.
@mildas I found a few more issues. Sorry.
tests/README.md
Outdated
test_dir=$(find $ssg_root/tests/data/ -type d -name *$rule_id*) | ||
|
||
if [ ! -z "$test_dir" ]; then | ||
printf "Test scenarios for rules their name contains \"$rule_id\" can be found at:\n$test_dir\n" |
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.
This sentence is strange.
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.
I tried to rephrase it. But now it's missing the information that the "string" was used as globbing pattern.
LGTM, thanks @mildas for the updates. |
Description:
Improve the tests/README.md to document where test scenarios are located and suggests the users to use a bash function to quickly find the test scenarios for a given rule.
Rationale:
Improves the SSGTS documentation.