-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fixes #5761: --test_target flag will redirect to its test file. #6014
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #6014 +/- ##
=======================================
Coverage 45.3% 45.3%
=======================================
Files 520 520
Lines 30667 30667
Branches 4597 4597
=======================================
Hits 13893 13893
Misses 16774 16774 Continue to review full report at Codecov.
|
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 @anubhavsinha98, ptal!
scripts/backend_tests.py
Outdated
@@ -240,6 +240,9 @@ def _convert_to_test_target(path): | |||
def main(): | |||
"""Run the tests.""" | |||
parsed_args = _PARSER.parse_args() | |||
if parsed_args.test_target is not None: |
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.
Merge both the if
conditions with this condition.
@apb7 , made the changes. PTAL ! |
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.
You can display a warning message if the user entered the wrong command as it was suggested here. Otherwise looks good. Thanks :)
@lilithxxx ,can you explain what that wrong command would be as I am not able to recognize? |
The one without |
scripts/backend_tests.py
Outdated
@@ -249,7 +249,10 @@ def main(): | |||
raise Exception('The delimiter in test_target should be a dot (.)') | |||
|
|||
if parsed_args.test_target: | |||
all_test_targets = [parsed_args.test_target] | |||
if parsed_args.test_target.endswith('test'): |
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.
Um can you make it endswith('_test') so as to make it more precise? Thanks
@lilithxxx, adding the warning message and as @seanlip suggested adding a delay of 3 seconds here also. |
@apb7 , @lilithxxx PTAL ! |
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.
@anubhavsinha98, just a couple of minor nits. Thanks!
scripts/backend_tests.py
Outdated
else: | ||
print '' | ||
print '.....................................................' | ||
print 'WARNING : test_target flag should contain test file.' |
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.
Change this to WARNING : test_target flag should point to the test file.
scripts/backend_tests.py
Outdated
print '.....................................................' | ||
print '' | ||
time.sleep(3) | ||
print 'Redirecting to its corresponding test file.' |
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.
Change this to Redirecting to its corresponding test file...
Changes done @apb7 , PTAL ! |
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.
Looking all good! @lilithxxx, would you like to review the changes? Thanks!
scripts/backend_tests.py
Outdated
print '' | ||
print '.....................................................' | ||
print 'WARNING : test_target flag should point to the test file.' | ||
print '.....................................................' |
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.
Just a confirmation, do we normally use . or -?
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.
Hmm..I think -
. Nice catch, @nithusha21! @anubhavsinha98, can you please change this? Thanks!
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.
Yea I think we use -
@anubhavsinha98 Would you change it please?
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.
Oops -- sorry @apb7 you already mentioned it.
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.
Okay, will change it !
Sorry my fault.
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.
LGTM! Thanks @anubhavsinha98
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.
Un-approving till this is resolved. Thanks!
Yes @apb7 , I am using the same email in Github and CLA. |
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.
Uh, why this commit?
Really sorry for that. I tested it if any issue is occuring with my github mail. |
I understand. Please undo the last commit -- in general, do not commit if your PR has been previously approved. Thanks! |
0e39c21
to
f25ad48
Compare
Sorry for unconvinience @apb7 , corrected the commit. |
@apb7 , actually I had not set up mail in the git configurations therefore it was showing codician |
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.
Checked with @anubhavsinha98: He has used the same email for signing the CLA as the one used by GitHub. Thanks!
It breaks when I try to run test from a subclass inside a file, like |
Okay, good job @gurungrahul2. Nice catch. |
Actually @gurungrahul2 , I was not aware of the fact that we can test the particular subclass also. |
Explanation
Fixes #5761 --test_target flag will redirect to its corresponding backend test file. For ex
--test_target='core.domain.feedback_services'
will be same as--test_target='core.domain.feedback_services_test'
.Checklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.