-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix #5885 Only run front end test when front end file changed #5936
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #5936 +/- ##
===========================================
- Coverage 45.48% 45.19% -0.29%
===========================================
Files 517 525 +8
Lines 30372 31524 +1152
Branches 4568 4737 +169
===========================================
+ Hits 13814 14247 +433
- Misses 16558 17277 +719
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.
Thanks @EvsChen! Took a pass, PTAL :)
Also, I suppose the frontend presubmit checks didn't run when you pushed this PR? You might want to do a test by pushing some frontend changes and making sure the presubmit checks run in that case, then reverting them in a subsequent commit -- always a good idea to test the end-to-end flow manually.
Hi @seanlip, thanks for your advice. Actually using your method I did find a problem. Would it be sufficient to only check against the local |
Actually, shouldn't we compare against "current tip of branch on github"? |
Like, if I push commits A, B, C to github, and then prepare a local set of changes in commits D, E, F, G, then on presubmit the question is really whether D/E/F/G contain any frontend changes. |
So the current logic is: |
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 couple more questions, thanks!
Could you also confirm you've manually tested the whole flow (as a developer) using various cases? Important to make sure this is done end-to-end, so we don't break things for other folks.
This reverts commit d0f8c78.
|
||
echo "Comparing the current branch with $BRANCH" | ||
|
||
if [ -n "$(git diff --cached --name-only --diff-filter=ACM ${BRANCH} | grep ${FRONTEND_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.
Ah, take a look at this maybe: https://superuser.com/a/750913
Gives you an explanation of why there are no brackets as well as introducing the -q arg. If you decide to go this route, might be worth referring to this link in a comment.
Apart from that, I think this PR looks good. Once you confirm (by a top-level comment on this PR) that you have manually tested it, it can go in. The manual testing is necessary, I think; there are often hidden issues in bash scripts, and neither you nor I are super familiar with the language, so we need to make sure that this works correctly end-to-end in all cases.
Also, in your comment, please provide a specific list of which scenarios you have manually tested, for future reference -- that way, if this breaks for someone, we can see if it wasn't included here in the first place, or if there's some kind of system-dependent behaviour. Thanks!
Manually I've tested on the following environments. We may need further tests on windows env but I don't have one at the moment:)
|
Hi @nithusha21, can you help us to find people who can help to test this PR on windows? |
Ummm, I sent out a message on our gitter chat, for people using windows for development. Didn't get any responses. I don't have access to windows myself either. Not sure if there are any active developers using windows for Oppia development. Do you think the current testing is sufficient in this case? Most of the crowd uses Linux/Mac. If after merging, if we get any error reports, then we would need @EvsChen to investigate :). |
@nithusha21, Sounds good to me! |
Hi Sandeep! I am traveling today. I will go through the changes and maybe
test it once tomorrow. Thanks!
On Dec 16, 2018 1:41 PM, "Sandeep Dubey" <notifications@github.com> wrote:
@nithusha21 <https://github.com/nithusha21>, Sounds good to me!
@apb7 <https://github.com/apb7>, do you have any suggestion on this? (If it
looks fine to you then can you please approve this PR as a CODEOWNER?)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5936 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AXrQufiZffChoUxNcisFAR51kd3FwpjTks5u5gA4gaJpZM4Y9OOI>
.
|
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.
Thanks, @EvsChen!
Dismissing @seanlip's review because of the following:
Thanks! |
Explanation
Fix #5885:
This PR changes the
pre_submit_test.sh
workflow. If the front end files, i.e. all the files undercore/templates/dev/head
, not changed, then it skips the front end check.By default, it compares the local committed changes against the
origin/develop
branch, but you can also pass your working branch name by the followingChecklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.