-
-
Notifications
You must be signed in to change notification settings - Fork 73
Update toolchain #878
Update toolchain #878
Changes from 15 commits
ab2de02
4c1b4df
0fc5749
6a8b0a9
2063cc7
50b9a97
993f653
bce90ed
ef38957
2840f03
0c60032
c289908
1f4d705
873508f
75b6ae1
21910c3
381e49d
c8985e3
6c086e3
4378ec0
eef129b
c7d7a5d
c6ac560
7bb2f85
c37de12
bdce3fb
1f334e9
721c3e8
4a64b1c
1a6c639
449245b
fa79934
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,15 @@ version: 2.1 | |
jobs: | ||
"server-test": | ||
docker: | ||
- image: circleci/python:3.7.9-node-browsers | ||
- image: circleci/python:3.9.2-buster-node-browsers | ||
environment: | ||
PERCY_PARALLEL_TOTAL: -1 | ||
- image: cypress/base:10 | ||
|
||
steps: | ||
- checkout | ||
- run: | ||
name: Inject Percy Environment variables | ||
command: | | ||
echo 'export PERCY_TOKEN="$PERCY_TOKEN_E2E"' >> $BASH_ENV | ||
|
||
- restore_cache: | ||
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} | ||
- run: | ||
|
@@ -24,18 +21,15 @@ jobs: | |
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} | ||
paths: | ||
- node_modules | ||
alexcjohnson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- run: | ||
name: Install requirements | ||
command: | | ||
sudo pip install --upgrade virtualenv | ||
python -m venv venv || virtualenv venv | ||
python -m venv venv | ||
. venv/bin/activate | ||
pip install -r dev-requirements.txt --quiet | ||
git clone --depth 1 git@github.com:plotly/dash.git dash-main | ||
pip install -e ./dash-main[dev,testing] --quiet | ||
cd dash-main/dash-renderer && npm ci && npm run build && pip install -e . && cd ./../.. | ||
|
||
- run: | ||
name: Build | ||
command: | | ||
|
@@ -45,7 +39,6 @@ jobs: | |
python setup.py sdist | ||
cd dist | ||
find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd .. | ||
|
||
- run: | ||
name: Run tests | ||
command: | | ||
|
@@ -56,101 +49,50 @@ jobs: | |
command: npx percy finalize --all | ||
when: always | ||
|
||
|
||
"standalone-test": | ||
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. These tests have been ported to test-server / Selenium 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.
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. @alexcjohnson I've tried but for some reason one of the test consistently fails with parallelism turned on. I've got no idea why. Can try and figure it out before we consider this PR ready. 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.
There's one set of tests that is extremely long to run with Selenium (lots of DOM checks). The minimal run time with per-file slicing is probably not lower than 15-20 minutes because of that test and its variations. https://github.com/plotly/dash-table/blob/dev/tests/selenium/test_sizing.py Out of scope for this PR: it should be possible to rewrite that test to run the checks directly from the browser (Karma) instead and improve its speed by at least an order of magnitude. 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. @alexcjohnson Figured out what I did wrong. Also, broke down the large test with lots of permutations into many smaller tests in their own files. The last run took ~28 minutes but I expect the CI time splitting algorithm to be able to optimize this down to below 20 minutes soon enough. 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.
Excellent, which change fixed this?
OK, that's reasonable for now, thanks! 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.
When I updated the CI yaml to run tests in parallel, I copied it over from the DCC CI yaml which runs pytest with the |
||
docker: | ||
- image: circleci/python:3.6.7-node-browsers | ||
- image: cypress/base:10 | ||
|
||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} | ||
- run: | ||
name: Install npm packages | ||
command: npm ci | ||
- run: | ||
name: Cypress Install | ||
command: | | ||
$(npm bin)/cypress install | ||
|
||
- save_cache: | ||
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} | ||
paths: | ||
- node_modules | ||
- /home/circleci/.cache/Cypress | ||
|
||
- run: | ||
name: Run tests | ||
command: | | ||
rm -rf node_modules/cypress | ||
npm i cypress@3.4.1 | ||
npm run test.standalone | ||
|
||
|
||
"unit-test": | ||
docker: | ||
- image: circleci/python:3.7.5-node-browsers | ||
- image: cypress/base:10 | ||
|
||
- image: circleci/python:3.9.2-buster-node-browsers | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} | ||
- run: | ||
name: Install npm packages | ||
command: npm ci | ||
- run: | ||
name: Cypress Install | ||
command: | | ||
$(npm bin)/cypress install | ||
|
||
- save_cache: | ||
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} | ||
paths: | ||
- node_modules | ||
- /home/circleci/.cache/Cypress | ||
|
||
- run: | ||
name: Install requirements | ||
command: | | ||
sudo pip install --upgrade virtualenv | ||
python -m venv venv || virtualenv venv | ||
python -m venv venv | ||
. venv/bin/activate | ||
pip install -r dev-requirements.txt --quiet | ||
pip install --progress-bar off -e git+https://github.com/plotly/dash.git@dev#egg=dash[dev,testing] | ||
|
||
- run: | ||
name: Run tests | ||
command: | | ||
. venv/bin/activate | ||
npm run build | ||
npm run test.unit | ||
|
||
|
||
"visual-test": | ||
docker: | ||
- image: circleci/node:10-browsers | ||
|
||
- image: circleci/node:14-browsers | ||
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. Node14 is the current active LTS and some npm packages are starting to drop v10. Preventive more than anything. |
||
steps: | ||
- checkout | ||
|
||
- restore_cache: | ||
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }} | ||
|
||
- run: | ||
name: Install package.json | ||
command: npm ci | ||
|
||
- save_cache: | ||
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }} | ||
paths: | ||
- node_modules | ||
|
||
- run: | ||
name: Run build:js | ||
command: npm run private::build:js | ||
|
||
- run: | ||
name: Run visual tests | ||
command: npm run test.visual | ||
|
@@ -159,34 +101,25 @@ jobs: | |
|
||
"node": | ||
docker: | ||
- image: circleci/python:3.7.5-node | ||
|
||
- image: circleci/python:3.9.2-node | ||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: Create virtual env | ||
command: python -m venv || virtualenv venv | ||
|
||
- restore_cache: | ||
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }} | ||
|
||
- run: | ||
name: Install package.json | ||
command: npm ci | ||
|
||
- save_cache: | ||
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }} | ||
paths: | ||
- node_modules | ||
|
||
- run: | ||
name: Install requirements | ||
command: | | ||
. venv/bin/activate | ||
pip install -r dev-requirements.txt --quiet | ||
pip install --progress-bar off -e git+https://github.com/plotly/dash.git@dev#egg=dash[dev,testing] | ||
|
||
- run: | ||
name: Run eslint | ||
command: | | ||
|
@@ -200,6 +133,5 @@ workflows: | |
jobs: | ||
- "node" | ||
- "server-test" | ||
- "standalone-test" | ||
- "unit-test" | ||
- "visual-test" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ module.exports = (options = {}) => { | |
mode: mode, | ||
output: { | ||
path: path.resolve(__dirname, `./../../${dashLibraryName}`), | ||
chunkFilename: '[name].js', | ||
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. Changed from Wepback4 -> 5 -- see |
||
filename: '[name].js', | ||
library: dashLibraryName, | ||
libraryTarget: 'window' | ||
|
@@ -40,15 +39,18 @@ module.exports = (options = {}) => { | |
rules: [ | ||
{ | ||
test: /demo[\\\/]index.html?$/, | ||
loader: 'file-loader?name=index.[ext]' | ||
loader: 'file-loader', | ||
options: { | ||
name: 'index.[ext]' | ||
} | ||
}, | ||
{ | ||
test: /\.csv$/, | ||
loader: 'raw-loader' | ||
}, | ||
{ | ||
test: /\.ts(x?)$/, | ||
include: /node_modules[\\\/](highlight[.]js)[\\\/]/, | ||
include: /node_modules[\\\/](highlight[.]js|d3-format)[\\\/]/, | ||
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.
|
||
use: [ | ||
{ loader: 'babel-loader', options: babel }, | ||
{ loader: 'ts-loader', options: ts }, | ||
|
@@ -65,7 +67,7 @@ module.exports = (options = {}) => { | |
}, | ||
{ | ||
test: /\.js$/, | ||
include: /node_modules[\\\/](highlight[.]js)[\\\/]/, | ||
include: /node_modules[\\\/](highlight[.]js|d3-format)[\\\/]/, | ||
use: [ | ||
{ loader: 'babel-loader', options: babel } | ||
] | ||
|
@@ -97,7 +99,6 @@ module.exports = (options = {}) => { | |
}, | ||
resolve: { | ||
alias: { | ||
cypress: path.resolve('./tests/cypress/src'), | ||
'dash-table': path.resolve('./src/dash-table'), | ||
demo: path.resolve('./demo'), | ||
core: path.resolve('./src/core'), | ||
|
@@ -108,7 +109,7 @@ module.exports = (options = {}) => { | |
optimization: { | ||
splitChunks: { | ||
chunks: 'async', | ||
name: true, | ||
name: '[name].js', | ||
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. Changed from Wepback4 -> 5 |
||
cacheGroups: { | ||
async: { | ||
chunks: 'async', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[flake8] | ||
ignore = C901, E203, E266, E501, E731, W503 | ||
ignore = C901, E203, E231, E266, E501, E731, W503 | ||
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. Flask / Black spacing and trailing |
||
select = B,C,E,F,W,T4 | ||
per-file-ignores = | ||
tests/*: E722, F811 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ Project.toml | |
|
||
# testing | ||
/coverage | ||
/tests/cypress/screenshots/** | ||
/storybook-static/** | ||
|
||
# misc | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = config => { | ||
config.set({ | ||
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. Karma replaces Cypress as the unit test runner. Configuration to run in the desired env the desired tests correctly bundled. |
||
frameworks: ['mocha', 'webpack'], | ||
|
||
plugins: [ | ||
'karma-webpack', | ||
'karma-mocha', | ||
'karma-chrome-launcher' | ||
], | ||
preprocessors: { | ||
// add webpack as preprocessor | ||
'tests/js-unit/**/*.ts': ['webpack'] | ||
}, | ||
files: [ | ||
'node_modules/babel-polyfill/dist/polyfill.js', | ||
'node_modules/regenerator-runtime/runtime.js', | ||
'tests/js-unit/**/*.ts' // *.tsx for React Jsx | ||
], | ||
reporters: ["progress"], | ||
browsers: ["Chrome"], | ||
webpack: require('./webpack.test.config') | ||
}); | ||
} |
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.
Updating to use py3.9 as per https://github.com/plotly/dash-core/issues/203
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.
For now, can't use the new CircleCI
cimg
becauseCHROME_BIN
is missing and expected by Karma