-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Split cypress tests #6241
Split cypress tests #6241
Conversation
d0c83a3
to
ec218d0
Compare
Codecov Report
@@ Coverage Diff @@
## master #6241 +/- ##
=======================================
Coverage 77.31% 77.31%
=======================================
Files 67 67
Lines 9581 9581
=======================================
Hits 7408 7408
Misses 2173 2173 Continue to review full report at Codecov.
|
22888d1
to
f050685
Compare
c2d83c3
to
a070e4a
Compare
8840356
to
34fb0d6
Compare
697fac5
to
f5a9033
Compare
npm run build | ||
npm run cypress run | ||
#run all the python steps in a background process | ||
(time /home/travis/build/apache/incubator-superset/superset/bin/superset db upgrade; time /home/travis/build/apache/incubator-superset/superset/bin/superset load_test_users; /home/travis/build/apache/incubator-superset/superset/bin/superset load_examples; time /home/travis/build/apache/incubator-superset/superset/bin/superset init; echo "[completed python build steps]"; flask run -p 8081 --with-threads --reload --debugger) & |
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.
did you mean to leave the time
statements in here?
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.
yeah, I left it there so we can see how long each subpart takes
🙏 thanks so much for doing this 👍 |
.travis.yml
Outdated
@@ -4,7 +4,33 @@ jobs: | |||
include: | |||
- language: python | |||
python: 3.6 | |||
env: TOXENV=cypress | |||
env: TOXENV=cypress_dashboard |
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.
Using a matrix here might help to reduce the repetition.
tox.ini
Outdated
@@ -45,9 +45,31 @@ setenv = | |||
whitelist_externals = | |||
npm | |||
|
|||
[testenv:cypress] | |||
[testenv:cypress_dashboard] |
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.
The use of factor conditions for the command could help reduce the repetition.
f5a9033
to
741c06f
Compare
npm run build | ||
npm run cypress run | ||
#run all the python steps in a background process | ||
(time /home/travis/build/apache/incubator-superset/superset/bin/superset db upgrade; time /home/travis/build/apache/incubator-superset/superset/bin/superset load_test_users; /home/travis/build/apache/incubator-superset/superset/bin/superset load_examples; time /home/travis/build/apache/incubator-superset/superset/bin/superset init; echo "[completed python build steps]"; flask run -p 8081 --with-threads --reload --debugger) & |
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.
Should we be using &&
rather than ;
here per this?
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 think either way is fine. They will both lead to a failed build if something goes wrong in the middle
#run all the python steps in a background process | ||
(time /home/travis/build/apache/incubator-superset/superset/bin/superset db upgrade; time /home/travis/build/apache/incubator-superset/superset/bin/superset load_test_users; /home/travis/build/apache/incubator-superset/superset/bin/superset load_examples; time /home/travis/build/apache/incubator-superset/superset/bin/superset init; echo "[completed python build steps]"; flask run -p 8081 --with-threads --reload --debugger) & | ||
|
||
#block on the longer running javascript process |
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.
It seems like we should have flask run
run after we've run npm run build
as then there's no need to background the task above.
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.
npm run build takes a really long time esp when it freezes on 92%. So I decided to put in as much as possible in the background while it is running so as to save the time it will take to run if it were to run after npm run build
(time /home/travis/build/apache/incubator-superset/superset/bin/superset db upgrade; time /home/travis/build/apache/incubator-superset/superset/bin/superset load_test_users; /home/travis/build/apache/incubator-superset/superset/bin/superset load_examples; time /home/travis/build/apache/incubator-superset/superset/bin/superset init; echo "[completed python build steps]"; flask run -p 8081 --with-threads --reload --debugger) & | ||
|
||
#block on the longer running javascript process | ||
(time yarn install --frozen-lockfile; time npm run build; echo "[completed js build steps]") |
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.
See note ^^.
* aplit cypress tests * split into three
This PR reduces the cypress runtime from ~18 minutes to ~11 minutes. It uses a few techniques listed below:
It also times each subcomponent so we can track how the times are growing
@mistercrunch @michellethomas @john-bodley