This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ab2de02
update toolchain to use webpack 5 amongst other things and remove Cyp…
Mar 18, 2021
4c1b4df
move last cypress test to selenium
Mar 19, 2021
0fc5749
clean up cypress related code
Mar 19, 2021
6a8b0a9
remove unused parameter `run`
Mar 19, 2021
2063cc7
parallelism 2
Mar 19, 2021
50b9a97
undo parallelism
Mar 19, 2021
993f653
probably safe updates + prettier formatting changes
Mar 19, 2021
bce90ed
update additional depedencies (d3-format, husky, less)
Mar 19, 2021
ef38957
d3-format v2 changes the minus character (https://github.com/d3/d3-fo…
Mar 19, 2021
2840f03
d3-format: fix additional test entry
Mar 19, 2021
0c60032
- webpack-dev-server -> webpack serve
Mar 19, 2021
c289908
webpack-dev-server (after all it's required by webpack serve)
Mar 19, 2021
1f4d705
remove standalone configuration
Mar 19, 2021
873508f
add back restore/save cache
Mar 19, 2021
75b6ae1
remove virtualenv usage
Mar 19, 2021
21910c3
save path
Mar 19, 2021
381e49d
switch out deprecated tslint for typescript/eslint
Mar 19, 2021
c8985e3
eslint fixes
Mar 19, 2021
6c086e3
add a tsconfig for linting
Mar 19, 2021
4378ec0
remove time.sleep in test
Mar 19, 2021
eef129b
try parallelism again..
Mar 20, 2021
c7d7a5d
parallelism=4
Mar 20, 2021
c6ac560
percy-finalize step
Mar 21, 2021
7bb2f85
remove last virtualenv
Mar 21, 2021
c37de12
runs
Mar 21, 2021
bdce3fb
inject
Mar 21, 2021
1f334e9
quotes?
Mar 21, 2021
721c3e8
.
Mar 21, 2021
4a64b1c
venv venv
Mar 21, 2021
1a6c639
finalize
Mar 21, 2021
449245b
slice up szng003 into multiple functions so it can be time sliced in CI
Mar 21, 2021
fa79934
sizing into files
Mar 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 29 additions & 78 deletions .circleci/config.yml
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
version: 2.1

jobs:
percy-finalize:
docker:
- image: percyio/agent
steps:
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_TOKEN_E2E"' >> $BASH_ENV
- run: percy finalize --all

"server-test":
docker:
- image: circleci/python:3.7.9-node-browsers
- image: circleci/python:3.9.2-buster-node-browsers

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
ContributorAuthor

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 because CHROME_BIN is missing and expected by Karma

environment:
PERCY_PARALLEL_TOTAL: -1
- image: cypress/base:10

parallelism: 4
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:
Expand All@@ -24,18 +32,15 @@ jobs:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules
Comment thread
alexcjohnson marked this conversation as 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: |
Expand All@@ -45,112 +50,63 @@ jobs:
python setup.py sdist
cd dist
find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd ..

- run:
name: Run tests
command: |
. venv/bin/activate
npm run test.server
- run:
name: 🦔 percy finalize
command: npx percy finalize --all
when: always


"standalone-test":

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests have been ported to test-server / Selenium

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-server is awfully long now, nearly an hour. Can we parallelize it, shoot for <10min?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parallelize it, shoot for <10min?

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured out what I did wrong

Excellent, which change fixed this?

I expect the CI time splitting algorithm to be able to optimize this down to below 20 minutes soon enough.

OK, that's reasonable for now, thanks!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which change fixed this?

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 --headless flag. For some reason tbmu001, specifically, doesn't pass when it's run headless. Not absolutely sure why as I didn't investigate it further but headless Chrome is known for sometimes causing different behaviors

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

TESTFILES=$(circleci tests glob "tests/selenium/**/test_*.py" | circleci tests split --split-by=timings)
pytest --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
- store_artifacts:
path: test-reports
- store_test_results:
path: test-reports
- store_artifacts:
path: /tmp/dash_artifacts

"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

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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
Expand All@@ -159,34 +115,27 @@ 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

command: python -m venv 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: |
Expand All@@ -200,6 +149,8 @@ workflows:
jobs:
- "node"
- "server-test"
- "standalone-test"
- "unit-test"
- "visual-test"
- percy-finalize:
requires:
- server-test
12 changes: 0 additions & 12 deletions .config/tslint.json

This file was deleted.

13 changes: 7 additions & 6 deletions .config/webpack/base.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,6 @@ module.exports = (options = {}) => {
mode: mode,
output: {
path: path.resolve(__dirname, `./../../${dashLibraryName}`),
chunkFilename: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5 -- see optimization section

filename: '[name].js',
library: dashLibraryName,
libraryTarget: 'window'
Expand All@@ -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)[\\\/]/,

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d3-format v2 is now bundled in ES6, we need to transpile it to ES5 for our IE11 support.

use: [
{ loader: 'babel-loader', options: babel },
{ loader: 'ts-loader', options: ts },
Expand All@@ -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 }
]
Expand DownExpand Up@@ -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'),
Expand All@@ -108,7 +109,7 @@ module.exports = (options = {}) => {
optimization: {
splitChunks: {
chunks: 'async',
name: true,
name: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5

cacheGroups: {
async: {
chunks: 'async',
Expand Down
59 changes: 59 additions & 0 deletions .eslintrc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": "./tsconfig.lint.json"
},
"rules": {
"arrow-parens": [
2,
"as-needed"
],
"comma-dangle": [
2,
"never"
],
"no-unused-expressions": 2,
"no-unused-vars": 0,
"prefer-arrow-callback": 2,
"quote-props": [
2,
"as-needed"
],
"quotes": [
2,
"single",
{ "avoidEscape": true }
],
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/array-type": 0,
"@typescript-eslint/eofline": 0,
"@typescript-eslint/max-classes-per-file": 0,
"@typescript-eslint/max-line-length": 0,
"@typescript-eslint/member-access": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/no-conditional-assignment": 0,
"@typescript-eslint/no-empty": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "_" }],
"@typescript-eslint/object-literal-sort-keys": 0,
"@typescript-eslint/object-literal-shorthand": 0,
"@typescript-eslint/ordered-imports": 0,
"@typescript-eslint/prefer-const": 0,
"@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/space-before-function-paren": [
0,
"always"
],
"@typescript-eslint/unified-signatures": 0,
"@typescript-eslint/variable-name": 0
}
}
2 changes: 1 addition & 1 deletion .flake8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flask / Black spacing and trailing ,, deactivating in Flask and respecting Black formatting instead

select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
1 change: 0 additions & 1 deletion .gitignore
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,6 @@ Project.toml

# testing
/coverage
/tests/cypress/screenshots/**
/storybook-static/**

# misc
Expand Down
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,13 +12,17 @@ const baseConfig = require('./../.config/webpack/base.js')({
});

module.exports = {
core: { builder: 'webpack5' },
stories: ['./../tests/visual/percy-storybook/**/*.percy.tsx'],
webpackFinal: async (config, { configType }) => {
// jerry rig everything
config.resolve.alias.core = path.resolve(__dirname, './../src/core'),
config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

config.module = baseConfig.module;
config.stats = {
warnings: true
};

return config;
}
Expand Down
10 changes: 0 additions & 10 deletions cypress.json

This file was deleted.

Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ab2de02
update toolchain to use webpack 5 amongst other things and remove Cyp…
Mar 18, 2021
4c1b4df
move last cypress test to selenium
Mar 19, 2021
0fc5749
clean up cypress related code
Mar 19, 2021
6a8b0a9
remove unused parameter `run`
Mar 19, 2021
2063cc7
parallelism 2
Mar 19, 2021
50b9a97
undo parallelism
Mar 19, 2021
993f653
probably safe updates + prettier formatting changes
Mar 19, 2021
bce90ed
update additional depedencies (d3-format, husky, less)
Mar 19, 2021
ef38957
d3-format v2 changes the minus character (https://github.com/d3/d3-fo…
Mar 19, 2021
2840f03
d3-format: fix additional test entry
Mar 19, 2021
0c60032
- webpack-dev-server -> webpack serve
Mar 19, 2021
c289908
webpack-dev-server (after all it's required by webpack serve)
Mar 19, 2021
1f4d705
remove standalone configuration
Mar 19, 2021
873508f
add back restore/save cache
Mar 19, 2021
75b6ae1
remove virtualenv usage
Mar 19, 2021
21910c3
save path
Mar 19, 2021
381e49d
switch out deprecated tslint for typescript/eslint
Mar 19, 2021
c8985e3
eslint fixes
Mar 19, 2021
6c086e3
add a tsconfig for linting
Mar 19, 2021
4378ec0
remove time.sleep in test
Mar 19, 2021
eef129b
try parallelism again..
Mar 20, 2021
c7d7a5d
parallelism=4
Mar 20, 2021
c6ac560
percy-finalize step
Mar 21, 2021
7bb2f85
remove last virtualenv
Mar 21, 2021
c37de12
runs
Mar 21, 2021
bdce3fb
inject
Mar 21, 2021
1f334e9
quotes?
Mar 21, 2021
721c3e8
.
Mar 21, 2021
4a64b1c
venv venv
Mar 21, 2021
1a6c639
finalize
Mar 21, 2021
449245b
slice up szng003 into multiple functions so it can be time sliced in CI
Mar 21, 2021
fa79934
sizing into files
Mar 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 29 additions & 78 deletions .circleci/config.yml
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
version: 2.1

jobs:
percy-finalize:
docker:
- image: percyio/agent
steps:
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_TOKEN_E2E"' >> $BASH_ENV
- run: percy finalize --all

"server-test":
docker:
- image: circleci/python:3.7.9-node-browsers
- image: circleci/python:3.9.2-buster-node-browsers

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
ContributorAuthor

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 because CHROME_BIN is missing and expected by Karma

environment:
PERCY_PARALLEL_TOTAL: -1
- image: cypress/base:10

parallelism: 4
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:
Expand All@@ -24,18 +32,15 @@ jobs:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules
Comment thread
alexcjohnson marked this conversation as 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: |
Expand All@@ -45,112 +50,63 @@ jobs:
python setup.py sdist
cd dist
find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd ..

- run:
name: Run tests
command: |
. venv/bin/activate
npm run test.server
- run:
name: 🦔 percy finalize
command: npx percy finalize --all
when: always


"standalone-test":

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests have been ported to test-server / Selenium

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-server is awfully long now, nearly an hour. Can we parallelize it, shoot for <10min?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parallelize it, shoot for <10min?

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured out what I did wrong

Excellent, which change fixed this?

I expect the CI time splitting algorithm to be able to optimize this down to below 20 minutes soon enough.

OK, that's reasonable for now, thanks!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which change fixed this?

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 --headless flag. For some reason tbmu001, specifically, doesn't pass when it's run headless. Not absolutely sure why as I didn't investigate it further but headless Chrome is known for sometimes causing different behaviors

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

TESTFILES=$(circleci tests glob "tests/selenium/**/test_*.py" | circleci tests split --split-by=timings)
pytest --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
- store_artifacts:
path: test-reports
- store_test_results:
path: test-reports
- store_artifacts:
path: /tmp/dash_artifacts

"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

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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
Expand All@@ -159,34 +115,27 @@ 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

command: python -m venv 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: |
Expand All@@ -200,6 +149,8 @@ workflows:
jobs:
- "node"
- "server-test"
- "standalone-test"
- "unit-test"
- "visual-test"
- percy-finalize:
requires:
- server-test
12 changes: 0 additions & 12 deletions .config/tslint.json

This file was deleted.

13 changes: 7 additions & 6 deletions .config/webpack/base.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,6 @@ module.exports = (options = {}) => {
mode: mode,
output: {
path: path.resolve(__dirname, `./../../${dashLibraryName}`),
chunkFilename: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5 -- see optimization section

filename: '[name].js',
library: dashLibraryName,
libraryTarget: 'window'
Expand All@@ -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)[\\\/]/,

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d3-format v2 is now bundled in ES6, we need to transpile it to ES5 for our IE11 support.

use: [
{ loader: 'babel-loader', options: babel },
{ loader: 'ts-loader', options: ts },
Expand All@@ -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 }
]
Expand DownExpand Up@@ -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'),
Expand All@@ -108,7 +109,7 @@ module.exports = (options = {}) => {
optimization: {
splitChunks: {
chunks: 'async',
name: true,
name: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5

cacheGroups: {
async: {
chunks: 'async',
Expand Down
59 changes: 59 additions & 0 deletions .eslintrc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": "./tsconfig.lint.json"
},
"rules": {
"arrow-parens": [
2,
"as-needed"
],
"comma-dangle": [
2,
"never"
],
"no-unused-expressions": 2,
"no-unused-vars": 0,
"prefer-arrow-callback": 2,
"quote-props": [
2,
"as-needed"
],
"quotes": [
2,
"single",
{ "avoidEscape": true }
],
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/array-type": 0,
"@typescript-eslint/eofline": 0,
"@typescript-eslint/max-classes-per-file": 0,
"@typescript-eslint/max-line-length": 0,
"@typescript-eslint/member-access": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/no-conditional-assignment": 0,
"@typescript-eslint/no-empty": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "_" }],
"@typescript-eslint/object-literal-sort-keys": 0,
"@typescript-eslint/object-literal-shorthand": 0,
"@typescript-eslint/ordered-imports": 0,
"@typescript-eslint/prefer-const": 0,
"@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/space-before-function-paren": [
0,
"always"
],
"@typescript-eslint/unified-signatures": 0,
"@typescript-eslint/variable-name": 0
}
}
2 changes: 1 addition & 1 deletion .flake8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flask / Black spacing and trailing ,, deactivating in Flask and respecting Black formatting instead

select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
1 change: 0 additions & 1 deletion .gitignore
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,6 @@ Project.toml

# testing
/coverage
/tests/cypress/screenshots/**
/storybook-static/**

# misc
Expand Down
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,13 +12,17 @@ const baseConfig = require('./../.config/webpack/base.js')({
});

module.exports = {
core: { builder: 'webpack5' },
stories: ['./../tests/visual/percy-storybook/**/*.percy.tsx'],
webpackFinal: async (config, { configType }) => {
// jerry rig everything
config.resolve.alias.core = path.resolve(__dirname, './../src/core'),
config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

config.module = baseConfig.module;
config.stats = {
warnings: true
};

return config;
}
Expand Down
10 changes: 0 additions & 10 deletions cypress.json

This file was deleted.

Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ab2de02
update toolchain to use webpack 5 amongst other things and remove Cyp…
Mar 18, 2021
4c1b4df
move last cypress test to selenium
Mar 19, 2021
0fc5749
clean up cypress related code
Mar 19, 2021
6a8b0a9
remove unused parameter `run`
Mar 19, 2021
2063cc7
parallelism 2
Mar 19, 2021
50b9a97
undo parallelism
Mar 19, 2021
993f653
probably safe updates + prettier formatting changes
Mar 19, 2021
bce90ed
update additional depedencies (d3-format, husky, less)
Mar 19, 2021
ef38957
d3-format v2 changes the minus character (https://github.com/d3/d3-fo…
Mar 19, 2021
2840f03
d3-format: fix additional test entry
Mar 19, 2021
0c60032
- webpack-dev-server -> webpack serve
Mar 19, 2021
c289908
webpack-dev-server (after all it's required by webpack serve)
Mar 19, 2021
1f4d705
remove standalone configuration
Mar 19, 2021
873508f
add back restore/save cache
Mar 19, 2021
75b6ae1
remove virtualenv usage
Mar 19, 2021
21910c3
save path
Mar 19, 2021
381e49d
switch out deprecated tslint for typescript/eslint
Mar 19, 2021
c8985e3
eslint fixes
Mar 19, 2021
6c086e3
add a tsconfig for linting
Mar 19, 2021
4378ec0
remove time.sleep in test
Mar 19, 2021
eef129b
try parallelism again..
Mar 20, 2021
c7d7a5d
parallelism=4
Mar 20, 2021
c6ac560
percy-finalize step
Mar 21, 2021
7bb2f85
remove last virtualenv
Mar 21, 2021
c37de12
runs
Mar 21, 2021
bdce3fb
inject
Mar 21, 2021
1f334e9
quotes?
Mar 21, 2021
721c3e8
.
Mar 21, 2021
4a64b1c
venv venv
Mar 21, 2021
1a6c639
finalize
Mar 21, 2021
449245b
slice up szng003 into multiple functions so it can be time sliced in CI
Mar 21, 2021
fa79934
sizing into files
Mar 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 29 additions & 78 deletions .circleci/config.yml
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
version: 2.1

jobs:
percy-finalize:
docker:
- image: percyio/agent
steps:
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_TOKEN_E2E"' >> $BASH_ENV
- run: percy finalize --all

"server-test":
docker:
- image: circleci/python:3.7.9-node-browsers
- image: circleci/python:3.9.2-buster-node-browsers

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
ContributorAuthor

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 because CHROME_BIN is missing and expected by Karma

environment:
PERCY_PARALLEL_TOTAL: -1
- image: cypress/base:10

parallelism: 4
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:
Expand All@@ -24,18 +32,15 @@ jobs:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules
Comment thread
alexcjohnson marked this conversation as 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: |
Expand All@@ -45,112 +50,63 @@ jobs:
python setup.py sdist
cd dist
find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd ..

- run:
name: Run tests
command: |
. venv/bin/activate
npm run test.server
- run:
name: 🦔 percy finalize
command: npx percy finalize --all
when: always


"standalone-test":

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests have been ported to test-server / Selenium

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-server is awfully long now, nearly an hour. Can we parallelize it, shoot for <10min?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parallelize it, shoot for <10min?

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured out what I did wrong

Excellent, which change fixed this?

I expect the CI time splitting algorithm to be able to optimize this down to below 20 minutes soon enough.

OK, that's reasonable for now, thanks!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which change fixed this?

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 --headless flag. For some reason tbmu001, specifically, doesn't pass when it's run headless. Not absolutely sure why as I didn't investigate it further but headless Chrome is known for sometimes causing different behaviors

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

TESTFILES=$(circleci tests glob "tests/selenium/**/test_*.py" | circleci tests split --split-by=timings)
pytest --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
- store_artifacts:
path: test-reports
- store_test_results:
path: test-reports
- store_artifacts:
path: /tmp/dash_artifacts

"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

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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
Expand All@@ -159,34 +115,27 @@ 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

command: python -m venv 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: |
Expand All@@ -200,6 +149,8 @@ workflows:
jobs:
- "node"
- "server-test"
- "standalone-test"
- "unit-test"
- "visual-test"
- percy-finalize:
requires:
- server-test
12 changes: 0 additions & 12 deletions .config/tslint.json

This file was deleted.

13 changes: 7 additions & 6 deletions .config/webpack/base.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,6 @@ module.exports = (options = {}) => {
mode: mode,
output: {
path: path.resolve(__dirname, `./../../${dashLibraryName}`),
chunkFilename: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5 -- see optimization section

filename: '[name].js',
library: dashLibraryName,
libraryTarget: 'window'
Expand All@@ -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)[\\\/]/,

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d3-format v2 is now bundled in ES6, we need to transpile it to ES5 for our IE11 support.

use: [
{ loader: 'babel-loader', options: babel },
{ loader: 'ts-loader', options: ts },
Expand All@@ -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 }
]
Expand DownExpand Up@@ -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'),
Expand All@@ -108,7 +109,7 @@ module.exports = (options = {}) => {
optimization: {
splitChunks: {
chunks: 'async',
name: true,
name: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5

cacheGroups: {
async: {
chunks: 'async',
Expand Down
59 changes: 59 additions & 0 deletions .eslintrc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": "./tsconfig.lint.json"
},
"rules": {
"arrow-parens": [
2,
"as-needed"
],
"comma-dangle": [
2,
"never"
],
"no-unused-expressions": 2,
"no-unused-vars": 0,
"prefer-arrow-callback": 2,
"quote-props": [
2,
"as-needed"
],
"quotes": [
2,
"single",
{ "avoidEscape": true }
],
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/array-type": 0,
"@typescript-eslint/eofline": 0,
"@typescript-eslint/max-classes-per-file": 0,
"@typescript-eslint/max-line-length": 0,
"@typescript-eslint/member-access": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/no-conditional-assignment": 0,
"@typescript-eslint/no-empty": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "_" }],
"@typescript-eslint/object-literal-sort-keys": 0,
"@typescript-eslint/object-literal-shorthand": 0,
"@typescript-eslint/ordered-imports": 0,
"@typescript-eslint/prefer-const": 0,
"@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/space-before-function-paren": [
0,
"always"
],
"@typescript-eslint/unified-signatures": 0,
"@typescript-eslint/variable-name": 0
}
}
2 changes: 1 addition & 1 deletion .flake8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flask / Black spacing and trailing ,, deactivating in Flask and respecting Black formatting instead

select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
1 change: 0 additions & 1 deletion .gitignore
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,6 @@ Project.toml

# testing
/coverage
/tests/cypress/screenshots/**
/storybook-static/**

# misc
Expand Down
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,13 +12,17 @@ const baseConfig = require('./../.config/webpack/base.js')({
});

module.exports = {
core: { builder: 'webpack5' },
stories: ['./../tests/visual/percy-storybook/**/*.percy.tsx'],
webpackFinal: async (config, { configType }) => {
// jerry rig everything
config.resolve.alias.core = path.resolve(__dirname, './../src/core'),
config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

config.module = baseConfig.module;
config.stats = {
warnings: true
};

return config;
}
Expand Down
10 changes: 0 additions & 10 deletions cypress.json

This file was deleted.

Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ab2de02
update toolchain to use webpack 5 amongst other things and remove Cyp…
Mar 18, 2021
4c1b4df
move last cypress test to selenium
Mar 19, 2021
0fc5749
clean up cypress related code
Mar 19, 2021
6a8b0a9
remove unused parameter `run`
Mar 19, 2021
2063cc7
parallelism 2
Mar 19, 2021
50b9a97
undo parallelism
Mar 19, 2021
993f653
probably safe updates + prettier formatting changes
Mar 19, 2021
bce90ed
update additional depedencies (d3-format, husky, less)
Mar 19, 2021
ef38957
d3-format v2 changes the minus character (https://github.com/d3/d3-fo…
Mar 19, 2021
2840f03
d3-format: fix additional test entry
Mar 19, 2021
0c60032
- webpack-dev-server -> webpack serve
Mar 19, 2021
c289908
webpack-dev-server (after all it's required by webpack serve)
Mar 19, 2021
1f4d705
remove standalone configuration
Mar 19, 2021
873508f
add back restore/save cache
Mar 19, 2021
75b6ae1
remove virtualenv usage
Mar 19, 2021
21910c3
save path
Mar 19, 2021
381e49d
switch out deprecated tslint for typescript/eslint
Mar 19, 2021
c8985e3
eslint fixes
Mar 19, 2021
6c086e3
add a tsconfig for linting
Mar 19, 2021
4378ec0
remove time.sleep in test
Mar 19, 2021
eef129b
try parallelism again..
Mar 20, 2021
c7d7a5d
parallelism=4
Mar 20, 2021
c6ac560
percy-finalize step
Mar 21, 2021
7bb2f85
remove last virtualenv
Mar 21, 2021
c37de12
runs
Mar 21, 2021
bdce3fb
inject
Mar 21, 2021
1f334e9
quotes?
Mar 21, 2021
721c3e8
.
Mar 21, 2021
4a64b1c
venv venv
Mar 21, 2021
1a6c639
finalize
Mar 21, 2021
449245b
slice up szng003 into multiple functions so it can be time sliced in CI
Mar 21, 2021
fa79934
sizing into files
Mar 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 29 additions & 78 deletions .circleci/config.yml
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
version: 2.1

jobs:
percy-finalize:
docker:
- image: percyio/agent
steps:
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_TOKEN_E2E"' >> $BASH_ENV
- run: percy finalize --all

"server-test":
docker:
- image: circleci/python:3.7.9-node-browsers
- image: circleci/python:3.9.2-buster-node-browsers

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
ContributorAuthor

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 because CHROME_BIN is missing and expected by Karma

environment:
PERCY_PARALLEL_TOTAL: -1
- image: cypress/base:10

parallelism: 4
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:
Expand All@@ -24,18 +32,15 @@ jobs:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules
Comment thread
alexcjohnson marked this conversation as 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: |
Expand All@@ -45,112 +50,63 @@ jobs:
python setup.py sdist
cd dist
find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd ..

- run:
name: Run tests
command: |
. venv/bin/activate
npm run test.server
- run:
name: 🦔 percy finalize
command: npx percy finalize --all
when: always


"standalone-test":

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests have been ported to test-server / Selenium

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-server is awfully long now, nearly an hour. Can we parallelize it, shoot for <10min?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parallelize it, shoot for <10min?

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured out what I did wrong

Excellent, which change fixed this?

I expect the CI time splitting algorithm to be able to optimize this down to below 20 minutes soon enough.

OK, that's reasonable for now, thanks!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which change fixed this?

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 --headless flag. For some reason tbmu001, specifically, doesn't pass when it's run headless. Not absolutely sure why as I didn't investigate it further but headless Chrome is known for sometimes causing different behaviors

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

TESTFILES=$(circleci tests glob "tests/selenium/**/test_*.py" | circleci tests split --split-by=timings)
pytest --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
- store_artifacts:
path: test-reports
- store_test_results:
path: test-reports
- store_artifacts:
path: /tmp/dash_artifacts

"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

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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
Expand All@@ -159,34 +115,27 @@ 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

command: python -m venv 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: |
Expand All@@ -200,6 +149,8 @@ workflows:
jobs:
- "node"
- "server-test"
- "standalone-test"
- "unit-test"
- "visual-test"
- percy-finalize:
requires:
- server-test
12 changes: 0 additions & 12 deletions .config/tslint.json

This file was deleted.

13 changes: 7 additions & 6 deletions .config/webpack/base.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,6 @@ module.exports = (options = {}) => {
mode: mode,
output: {
path: path.resolve(__dirname, `./../../${dashLibraryName}`),
chunkFilename: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5 -- see optimization section

filename: '[name].js',
library: dashLibraryName,
libraryTarget: 'window'
Expand All@@ -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)[\\\/]/,

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d3-format v2 is now bundled in ES6, we need to transpile it to ES5 for our IE11 support.

use: [
{ loader: 'babel-loader', options: babel },
{ loader: 'ts-loader', options: ts },
Expand All@@ -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 }
]
Expand DownExpand Up@@ -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'),
Expand All@@ -108,7 +109,7 @@ module.exports = (options = {}) => {
optimization: {
splitChunks: {
chunks: 'async',
name: true,
name: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5

cacheGroups: {
async: {
chunks: 'async',
Expand Down
59 changes: 59 additions & 0 deletions .eslintrc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": "./tsconfig.lint.json"
},
"rules": {
"arrow-parens": [
2,
"as-needed"
],
"comma-dangle": [
2,
"never"
],
"no-unused-expressions": 2,
"no-unused-vars": 0,
"prefer-arrow-callback": 2,
"quote-props": [
2,
"as-needed"
],
"quotes": [
2,
"single",
{ "avoidEscape": true }
],
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/array-type": 0,
"@typescript-eslint/eofline": 0,
"@typescript-eslint/max-classes-per-file": 0,
"@typescript-eslint/max-line-length": 0,
"@typescript-eslint/member-access": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/no-conditional-assignment": 0,
"@typescript-eslint/no-empty": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "_" }],
"@typescript-eslint/object-literal-sort-keys": 0,
"@typescript-eslint/object-literal-shorthand": 0,
"@typescript-eslint/ordered-imports": 0,
"@typescript-eslint/prefer-const": 0,
"@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/space-before-function-paren": [
0,
"always"
],
"@typescript-eslint/unified-signatures": 0,
"@typescript-eslint/variable-name": 0
}
}
2 changes: 1 addition & 1 deletion .flake8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flask / Black spacing and trailing ,, deactivating in Flask and respecting Black formatting instead

select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
1 change: 0 additions & 1 deletion .gitignore
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,6 @@ Project.toml

# testing
/coverage
/tests/cypress/screenshots/**
/storybook-static/**

# misc
Expand Down
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,13 +12,17 @@ const baseConfig = require('./../.config/webpack/base.js')({
});

module.exports = {
core: { builder: 'webpack5' },
stories: ['./../tests/visual/percy-storybook/**/*.percy.tsx'],
webpackFinal: async (config, { configType }) => {
// jerry rig everything
config.resolve.alias.core = path.resolve(__dirname, './../src/core'),
config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

config.module = baseConfig.module;
config.stats = {
warnings: true
};

return config;
}
Expand Down
10 changes: 0 additions & 10 deletions cypress.json

This file was deleted.

Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ab2de02
update toolchain to use webpack 5 amongst other things and remove Cyp…
Mar 18, 2021
4c1b4df
move last cypress test to selenium
Mar 19, 2021
0fc5749
clean up cypress related code
Mar 19, 2021
6a8b0a9
remove unused parameter `run`
Mar 19, 2021
2063cc7
parallelism 2
Mar 19, 2021
50b9a97
undo parallelism
Mar 19, 2021
993f653
probably safe updates + prettier formatting changes
Mar 19, 2021
bce90ed
update additional depedencies (d3-format, husky, less)
Mar 19, 2021
ef38957
d3-format v2 changes the minus character (https://github.com/d3/d3-fo…
Mar 19, 2021
2840f03
d3-format: fix additional test entry
Mar 19, 2021
0c60032
- webpack-dev-server -> webpack serve
Mar 19, 2021
c289908
webpack-dev-server (after all it's required by webpack serve)
Mar 19, 2021
1f4d705
remove standalone configuration
Mar 19, 2021
873508f
add back restore/save cache
Mar 19, 2021
75b6ae1
remove virtualenv usage
Mar 19, 2021
21910c3
save path
Mar 19, 2021
381e49d
switch out deprecated tslint for typescript/eslint
Mar 19, 2021
c8985e3
eslint fixes
Mar 19, 2021
6c086e3
add a tsconfig for linting
Mar 19, 2021
4378ec0
remove time.sleep in test
Mar 19, 2021
eef129b
try parallelism again..
Mar 20, 2021
c7d7a5d
parallelism=4
Mar 20, 2021
c6ac560
percy-finalize step
Mar 21, 2021
7bb2f85
remove last virtualenv
Mar 21, 2021
c37de12
runs
Mar 21, 2021
bdce3fb
inject
Mar 21, 2021
1f334e9
quotes?
Mar 21, 2021
721c3e8
.
Mar 21, 2021
4a64b1c
venv venv
Mar 21, 2021
1a6c639
finalize
Mar 21, 2021
449245b
slice up szng003 into multiple functions so it can be time sliced in CI
Mar 21, 2021
fa79934
sizing into files
Mar 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 29 additions & 78 deletions .circleci/config.yml
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
version: 2.1

jobs:
percy-finalize:
docker:
- image: percyio/agent
steps:
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_TOKEN_E2E"' >> $BASH_ENV
- run: percy finalize --all

"server-test":
docker:
- image: circleci/python:3.7.9-node-browsers
- image: circleci/python:3.9.2-buster-node-browsers

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
ContributorAuthor

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 because CHROME_BIN is missing and expected by Karma

environment:
PERCY_PARALLEL_TOTAL: -1
- image: cypress/base:10

parallelism: 4
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:
Expand All@@ -24,18 +32,15 @@ jobs:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules
Comment thread
alexcjohnson marked this conversation as 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: |
Expand All@@ -45,112 +50,63 @@ jobs:
python setup.py sdist
cd dist
find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd ..

- run:
name: Run tests
command: |
. venv/bin/activate
npm run test.server
- run:
name: 🦔 percy finalize
command: npx percy finalize --all
when: always


"standalone-test":

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests have been ported to test-server / Selenium

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-server is awfully long now, nearly an hour. Can we parallelize it, shoot for <10min?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parallelize it, shoot for <10min?

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured out what I did wrong

Excellent, which change fixed this?

I expect the CI time splitting algorithm to be able to optimize this down to below 20 minutes soon enough.

OK, that's reasonable for now, thanks!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which change fixed this?

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 --headless flag. For some reason tbmu001, specifically, doesn't pass when it's run headless. Not absolutely sure why as I didn't investigate it further but headless Chrome is known for sometimes causing different behaviors

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

TESTFILES=$(circleci tests glob "tests/selenium/**/test_*.py" | circleci tests split --split-by=timings)
pytest --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
- store_artifacts:
path: test-reports
- store_test_results:
path: test-reports
- store_artifacts:
path: /tmp/dash_artifacts

"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

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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
Expand All@@ -159,34 +115,27 @@ 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

command: python -m venv 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: |
Expand All@@ -200,6 +149,8 @@ workflows:
jobs:
- "node"
- "server-test"
- "standalone-test"
- "unit-test"
- "visual-test"
- percy-finalize:
requires:
- server-test
12 changes: 0 additions & 12 deletions .config/tslint.json

This file was deleted.

13 changes: 7 additions & 6 deletions .config/webpack/base.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,6 @@ module.exports = (options = {}) => {
mode: mode,
output: {
path: path.resolve(__dirname, `./../../${dashLibraryName}`),
chunkFilename: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5 -- see optimization section

filename: '[name].js',
library: dashLibraryName,
libraryTarget: 'window'
Expand All@@ -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)[\\\/]/,

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d3-format v2 is now bundled in ES6, we need to transpile it to ES5 for our IE11 support.

use: [
{ loader: 'babel-loader', options: babel },
{ loader: 'ts-loader', options: ts },
Expand All@@ -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 }
]
Expand DownExpand Up@@ -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'),
Expand All@@ -108,7 +109,7 @@ module.exports = (options = {}) => {
optimization: {
splitChunks: {
chunks: 'async',
name: true,
name: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5

cacheGroups: {
async: {
chunks: 'async',
Expand Down
59 changes: 59 additions & 0 deletions .eslintrc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": "./tsconfig.lint.json"
},
"rules": {
"arrow-parens": [
2,
"as-needed"
],
"comma-dangle": [
2,
"never"
],
"no-unused-expressions": 2,
"no-unused-vars": 0,
"prefer-arrow-callback": 2,
"quote-props": [
2,
"as-needed"
],
"quotes": [
2,
"single",
{ "avoidEscape": true }
],
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/array-type": 0,
"@typescript-eslint/eofline": 0,
"@typescript-eslint/max-classes-per-file": 0,
"@typescript-eslint/max-line-length": 0,
"@typescript-eslint/member-access": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/no-conditional-assignment": 0,
"@typescript-eslint/no-empty": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "_" }],
"@typescript-eslint/object-literal-sort-keys": 0,
"@typescript-eslint/object-literal-shorthand": 0,
"@typescript-eslint/ordered-imports": 0,
"@typescript-eslint/prefer-const": 0,
"@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/space-before-function-paren": [
0,
"always"
],
"@typescript-eslint/unified-signatures": 0,
"@typescript-eslint/variable-name": 0
}
}
2 changes: 1 addition & 1 deletion .flake8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flask / Black spacing and trailing ,, deactivating in Flask and respecting Black formatting instead

select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
1 change: 0 additions & 1 deletion .gitignore
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,6 @@ Project.toml

# testing
/coverage
/tests/cypress/screenshots/**
/storybook-static/**

# misc
Expand Down
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,13 +12,17 @@ const baseConfig = require('./../.config/webpack/base.js')({
});

module.exports = {
core: { builder: 'webpack5' },
stories: ['./../tests/visual/percy-storybook/**/*.percy.tsx'],
webpackFinal: async (config, { configType }) => {
// jerry rig everything
config.resolve.alias.core = path.resolve(__dirname, './../src/core'),
config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

config.module = baseConfig.module;
config.stats = {
warnings: true
};

return config;
}
Expand Down
10 changes: 0 additions & 10 deletions cypress.json

This file was deleted.

Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ab2de02
update toolchain to use webpack 5 amongst other things and remove Cyp…
Mar 18, 2021
4c1b4df
move last cypress test to selenium
Mar 19, 2021
0fc5749
clean up cypress related code
Mar 19, 2021
6a8b0a9
remove unused parameter `run`
Mar 19, 2021
2063cc7
parallelism 2
Mar 19, 2021
50b9a97
undo parallelism
Mar 19, 2021
993f653
probably safe updates + prettier formatting changes
Mar 19, 2021
bce90ed
update additional depedencies (d3-format, husky, less)
Mar 19, 2021
ef38957
d3-format v2 changes the minus character (https://github.com/d3/d3-fo…
Mar 19, 2021
2840f03
d3-format: fix additional test entry
Mar 19, 2021
0c60032
- webpack-dev-server -> webpack serve
Mar 19, 2021
c289908
webpack-dev-server (after all it's required by webpack serve)
Mar 19, 2021
1f4d705
remove standalone configuration
Mar 19, 2021
873508f
add back restore/save cache
Mar 19, 2021
75b6ae1
remove virtualenv usage
Mar 19, 2021
21910c3
save path
Mar 19, 2021
381e49d
switch out deprecated tslint for typescript/eslint
Mar 19, 2021
c8985e3
eslint fixes
Mar 19, 2021
6c086e3
add a tsconfig for linting
Mar 19, 2021
4378ec0
remove time.sleep in test
Mar 19, 2021
eef129b
try parallelism again..
Mar 20, 2021
c7d7a5d
parallelism=4
Mar 20, 2021
c6ac560
percy-finalize step
Mar 21, 2021
7bb2f85
remove last virtualenv
Mar 21, 2021
c37de12
runs
Mar 21, 2021
bdce3fb
inject
Mar 21, 2021
1f334e9
quotes?
Mar 21, 2021
721c3e8
.
Mar 21, 2021
4a64b1c
venv venv
Mar 21, 2021
1a6c639
finalize
Mar 21, 2021
449245b
slice up szng003 into multiple functions so it can be time sliced in CI
Mar 21, 2021
fa79934
sizing into files
Mar 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 29 additions & 78 deletions .circleci/config.yml
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
version: 2.1

jobs:
percy-finalize:
docker:
- image: percyio/agent
steps:
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_TOKEN_E2E"' >> $BASH_ENV
- run: percy finalize --all

"server-test":
docker:
- image: circleci/python:3.7.9-node-browsers
- image: circleci/python:3.9.2-buster-node-browsers

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
ContributorAuthor

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 because CHROME_BIN is missing and expected by Karma

environment:
PERCY_PARALLEL_TOTAL: -1
- image: cypress/base:10

parallelism: 4
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:
Expand All@@ -24,18 +32,15 @@ jobs:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules
Comment thread
alexcjohnson marked this conversation as 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: |
Expand All@@ -45,112 +50,63 @@ jobs:
python setup.py sdist
cd dist
find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd ..

- run:
name: Run tests
command: |
. venv/bin/activate
npm run test.server
- run:
name: 🦔 percy finalize
command: npx percy finalize --all
when: always


"standalone-test":

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests have been ported to test-server / Selenium

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-server is awfully long now, nearly an hour. Can we parallelize it, shoot for <10min?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parallelize it, shoot for <10min?

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured out what I did wrong

Excellent, which change fixed this?

I expect the CI time splitting algorithm to be able to optimize this down to below 20 minutes soon enough.

OK, that's reasonable for now, thanks!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which change fixed this?

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 --headless flag. For some reason tbmu001, specifically, doesn't pass when it's run headless. Not absolutely sure why as I didn't investigate it further but headless Chrome is known for sometimes causing different behaviors

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

TESTFILES=$(circleci tests glob "tests/selenium/**/test_*.py" | circleci tests split --split-by=timings)
pytest --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
- store_artifacts:
path: test-reports
- store_test_results:
path: test-reports
- store_artifacts:
path: /tmp/dash_artifacts

"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

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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
Expand All@@ -159,34 +115,27 @@ 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

command: python -m venv 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: |
Expand All@@ -200,6 +149,8 @@ workflows:
jobs:
- "node"
- "server-test"
- "standalone-test"
- "unit-test"
- "visual-test"
- percy-finalize:
requires:
- server-test
12 changes: 0 additions & 12 deletions .config/tslint.json

This file was deleted.

13 changes: 7 additions & 6 deletions .config/webpack/base.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,6 @@ module.exports = (options = {}) => {
mode: mode,
output: {
path: path.resolve(__dirname, `./../../${dashLibraryName}`),
chunkFilename: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5 -- see optimization section

filename: '[name].js',
library: dashLibraryName,
libraryTarget: 'window'
Expand All@@ -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)[\\\/]/,

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d3-format v2 is now bundled in ES6, we need to transpile it to ES5 for our IE11 support.

use: [
{ loader: 'babel-loader', options: babel },
{ loader: 'ts-loader', options: ts },
Expand All@@ -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 }
]
Expand DownExpand Up@@ -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'),
Expand All@@ -108,7 +109,7 @@ module.exports = (options = {}) => {
optimization: {
splitChunks: {
chunks: 'async',
name: true,
name: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5

cacheGroups: {
async: {
chunks: 'async',
Expand Down
59 changes: 59 additions & 0 deletions .eslintrc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": "./tsconfig.lint.json"
},
"rules": {
"arrow-parens": [
2,
"as-needed"
],
"comma-dangle": [
2,
"never"
],
"no-unused-expressions": 2,
"no-unused-vars": 0,
"prefer-arrow-callback": 2,
"quote-props": [
2,
"as-needed"
],
"quotes": [
2,
"single",
{ "avoidEscape": true }
],
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/array-type": 0,
"@typescript-eslint/eofline": 0,
"@typescript-eslint/max-classes-per-file": 0,
"@typescript-eslint/max-line-length": 0,
"@typescript-eslint/member-access": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/no-conditional-assignment": 0,
"@typescript-eslint/no-empty": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "_" }],
"@typescript-eslint/object-literal-sort-keys": 0,
"@typescript-eslint/object-literal-shorthand": 0,
"@typescript-eslint/ordered-imports": 0,
"@typescript-eslint/prefer-const": 0,
"@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/space-before-function-paren": [
0,
"always"
],
"@typescript-eslint/unified-signatures": 0,
"@typescript-eslint/variable-name": 0
}
}
2 changes: 1 addition & 1 deletion .flake8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flask / Black spacing and trailing ,, deactivating in Flask and respecting Black formatting instead

select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
1 change: 0 additions & 1 deletion .gitignore
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,6 @@ Project.toml

# testing
/coverage
/tests/cypress/screenshots/**
/storybook-static/**

# misc
Expand Down
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,13 +12,17 @@ const baseConfig = require('./../.config/webpack/base.js')({
});

module.exports = {
core: { builder: 'webpack5' },
stories: ['./../tests/visual/percy-storybook/**/*.percy.tsx'],
webpackFinal: async (config, { configType }) => {
// jerry rig everything
config.resolve.alias.core = path.resolve(__dirname, './../src/core'),
config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

config.module = baseConfig.module;
config.stats = {
warnings: true
};

return config;
}
Expand Down
10 changes: 0 additions & 10 deletions cypress.json

This file was deleted.

Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ab2de02
update toolchain to use webpack 5 amongst other things and remove Cyp…
Mar 18, 2021
4c1b4df
move last cypress test to selenium
Mar 19, 2021
0fc5749
clean up cypress related code
Mar 19, 2021
6a8b0a9
remove unused parameter `run`
Mar 19, 2021
2063cc7
parallelism 2
Mar 19, 2021
50b9a97
undo parallelism
Mar 19, 2021
993f653
probably safe updates + prettier formatting changes
Mar 19, 2021
bce90ed
update additional depedencies (d3-format, husky, less)
Mar 19, 2021
ef38957
d3-format v2 changes the minus character (https://github.com/d3/d3-fo…
Mar 19, 2021
2840f03
d3-format: fix additional test entry
Mar 19, 2021
0c60032
- webpack-dev-server -> webpack serve
Mar 19, 2021
c289908
webpack-dev-server (after all it's required by webpack serve)
Mar 19, 2021
1f4d705
remove standalone configuration
Mar 19, 2021
873508f
add back restore/save cache
Mar 19, 2021
75b6ae1
remove virtualenv usage
Mar 19, 2021
21910c3
save path
Mar 19, 2021
381e49d
switch out deprecated tslint for typescript/eslint
Mar 19, 2021
c8985e3
eslint fixes
Mar 19, 2021
6c086e3
add a tsconfig for linting
Mar 19, 2021
4378ec0
remove time.sleep in test
Mar 19, 2021
eef129b
try parallelism again..
Mar 20, 2021
c7d7a5d
parallelism=4
Mar 20, 2021
c6ac560
percy-finalize step
Mar 21, 2021
7bb2f85
remove last virtualenv
Mar 21, 2021
c37de12
runs
Mar 21, 2021
bdce3fb
inject
Mar 21, 2021
1f334e9
quotes?
Mar 21, 2021
721c3e8
.
Mar 21, 2021
4a64b1c
venv venv
Mar 21, 2021
1a6c639
finalize
Mar 21, 2021
449245b
slice up szng003 into multiple functions so it can be time sliced in CI
Mar 21, 2021
fa79934
sizing into files
Mar 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 29 additions & 78 deletions .circleci/config.yml
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
version: 2.1

jobs:
percy-finalize:
docker:
- image: percyio/agent
steps:
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_TOKEN_E2E"' >> $BASH_ENV
- run: percy finalize --all

"server-test":
docker:
- image: circleci/python:3.7.9-node-browsers
- image: circleci/python:3.9.2-buster-node-browsers

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
ContributorAuthor

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 because CHROME_BIN is missing and expected by Karma

environment:
PERCY_PARALLEL_TOTAL: -1
- image: cypress/base:10

parallelism: 4
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:
Expand All@@ -24,18 +32,15 @@ jobs:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules
Comment thread
alexcjohnson marked this conversation as 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: |
Expand All@@ -45,112 +50,63 @@ jobs:
python setup.py sdist
cd dist
find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd ..

- run:
name: Run tests
command: |
. venv/bin/activate
npm run test.server
- run:
name: 🦔 percy finalize
command: npx percy finalize --all
when: always


"standalone-test":

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests have been ported to test-server / Selenium

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-server is awfully long now, nearly an hour. Can we parallelize it, shoot for <10min?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parallelize it, shoot for <10min?

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured out what I did wrong

Excellent, which change fixed this?

I expect the CI time splitting algorithm to be able to optimize this down to below 20 minutes soon enough.

OK, that's reasonable for now, thanks!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which change fixed this?

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 --headless flag. For some reason tbmu001, specifically, doesn't pass when it's run headless. Not absolutely sure why as I didn't investigate it further but headless Chrome is known for sometimes causing different behaviors

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

TESTFILES=$(circleci tests glob "tests/selenium/**/test_*.py" | circleci tests split --split-by=timings)
pytest --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
- store_artifacts:
path: test-reports
- store_test_results:
path: test-reports
- store_artifacts:
path: /tmp/dash_artifacts

"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

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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
Expand All@@ -159,34 +115,27 @@ 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

command: python -m venv 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: |
Expand All@@ -200,6 +149,8 @@ workflows:
jobs:
- "node"
- "server-test"
- "standalone-test"
- "unit-test"
- "visual-test"
- percy-finalize:
requires:
- server-test
12 changes: 0 additions & 12 deletions .config/tslint.json

This file was deleted.

13 changes: 7 additions & 6 deletions .config/webpack/base.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,6 @@ module.exports = (options = {}) => {
mode: mode,
output: {
path: path.resolve(__dirname, `./../../${dashLibraryName}`),
chunkFilename: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5 -- see optimization section

filename: '[name].js',
library: dashLibraryName,
libraryTarget: 'window'
Expand All@@ -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)[\\\/]/,

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d3-format v2 is now bundled in ES6, we need to transpile it to ES5 for our IE11 support.

use: [
{ loader: 'babel-loader', options: babel },
{ loader: 'ts-loader', options: ts },
Expand All@@ -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 }
]
Expand DownExpand Up@@ -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'),
Expand All@@ -108,7 +109,7 @@ module.exports = (options = {}) => {
optimization: {
splitChunks: {
chunks: 'async',
name: true,
name: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5

cacheGroups: {
async: {
chunks: 'async',
Expand Down
59 changes: 59 additions & 0 deletions .eslintrc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": "./tsconfig.lint.json"
},
"rules": {
"arrow-parens": [
2,
"as-needed"
],
"comma-dangle": [
2,
"never"
],
"no-unused-expressions": 2,
"no-unused-vars": 0,
"prefer-arrow-callback": 2,
"quote-props": [
2,
"as-needed"
],
"quotes": [
2,
"single",
{ "avoidEscape": true }
],
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/array-type": 0,
"@typescript-eslint/eofline": 0,
"@typescript-eslint/max-classes-per-file": 0,
"@typescript-eslint/max-line-length": 0,
"@typescript-eslint/member-access": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/no-conditional-assignment": 0,
"@typescript-eslint/no-empty": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "_" }],
"@typescript-eslint/object-literal-sort-keys": 0,
"@typescript-eslint/object-literal-shorthand": 0,
"@typescript-eslint/ordered-imports": 0,
"@typescript-eslint/prefer-const": 0,
"@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/space-before-function-paren": [
0,
"always"
],
"@typescript-eslint/unified-signatures": 0,
"@typescript-eslint/variable-name": 0
}
}
2 changes: 1 addition & 1 deletion .flake8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flask / Black spacing and trailing ,, deactivating in Flask and respecting Black formatting instead

select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
1 change: 0 additions & 1 deletion .gitignore
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,6 @@ Project.toml

# testing
/coverage
/tests/cypress/screenshots/**
/storybook-static/**

# misc
Expand Down
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,13 +12,17 @@ const baseConfig = require('./../.config/webpack/base.js')({
});

module.exports = {
core: { builder: 'webpack5' },
stories: ['./../tests/visual/percy-storybook/**/*.percy.tsx'],
webpackFinal: async (config, { configType }) => {
// jerry rig everything
config.resolve.alias.core = path.resolve(__dirname, './../src/core'),
config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

config.module = baseConfig.module;
config.stats = {
warnings: true
};

return config;
}
Expand Down
10 changes: 0 additions & 10 deletions cypress.json

This file was deleted.

Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ab2de02
update toolchain to use webpack 5 amongst other things and remove Cyp…
Mar 18, 2021
4c1b4df
move last cypress test to selenium
Mar 19, 2021
0fc5749
clean up cypress related code
Mar 19, 2021
6a8b0a9
remove unused parameter `run`
Mar 19, 2021
2063cc7
parallelism 2
Mar 19, 2021
50b9a97
undo parallelism
Mar 19, 2021
993f653
probably safe updates + prettier formatting changes
Mar 19, 2021
bce90ed
update additional depedencies (d3-format, husky, less)
Mar 19, 2021
ef38957
d3-format v2 changes the minus character (https://github.com/d3/d3-fo…
Mar 19, 2021
2840f03
d3-format: fix additional test entry
Mar 19, 2021
0c60032
- webpack-dev-server -> webpack serve
Mar 19, 2021
c289908
webpack-dev-server (after all it's required by webpack serve)
Mar 19, 2021
1f4d705
remove standalone configuration
Mar 19, 2021
873508f
add back restore/save cache
Mar 19, 2021
75b6ae1
remove virtualenv usage
Mar 19, 2021
21910c3
save path
Mar 19, 2021
381e49d
switch out deprecated tslint for typescript/eslint
Mar 19, 2021
c8985e3
eslint fixes
Mar 19, 2021
6c086e3
add a tsconfig for linting
Mar 19, 2021
4378ec0
remove time.sleep in test
Mar 19, 2021
eef129b
try parallelism again..
Mar 20, 2021
c7d7a5d
parallelism=4
Mar 20, 2021
c6ac560
percy-finalize step
Mar 21, 2021
7bb2f85
remove last virtualenv
Mar 21, 2021
c37de12
runs
Mar 21, 2021
bdce3fb
inject
Mar 21, 2021
1f334e9
quotes?
Mar 21, 2021
721c3e8
.
Mar 21, 2021
4a64b1c
venv venv
Mar 21, 2021
1a6c639
finalize
Mar 21, 2021
449245b
slice up szng003 into multiple functions so it can be time sliced in CI
Mar 21, 2021
fa79934
sizing into files
Mar 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 29 additions & 78 deletions .circleci/config.yml
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
version: 2.1

jobs:
percy-finalize:
docker:
- image: percyio/agent
steps:
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_TOKEN_E2E"' >> $BASH_ENV
- run: percy finalize --all

"server-test":
docker:
- image: circleci/python:3.7.9-node-browsers
- image: circleci/python:3.9.2-buster-node-browsers

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
ContributorAuthor

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 because CHROME_BIN is missing and expected by Karma

environment:
PERCY_PARALLEL_TOTAL: -1
- image: cypress/base:10

parallelism: 4
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:
Expand All@@ -24,18 +32,15 @@ jobs:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules
Comment thread
alexcjohnson marked this conversation as 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: |
Expand All@@ -45,112 +50,63 @@ jobs:
python setup.py sdist
cd dist
find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd ..

- run:
name: Run tests
command: |
. venv/bin/activate
npm run test.server
- run:
name: 🦔 percy finalize
command: npx percy finalize --all
when: always


"standalone-test":

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests have been ported to test-server / Selenium

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-server is awfully long now, nearly an hour. Can we parallelize it, shoot for <10min?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parallelize it, shoot for <10min?

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured out what I did wrong

Excellent, which change fixed this?

I expect the CI time splitting algorithm to be able to optimize this down to below 20 minutes soon enough.

OK, that's reasonable for now, thanks!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which change fixed this?

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 --headless flag. For some reason tbmu001, specifically, doesn't pass when it's run headless. Not absolutely sure why as I didn't investigate it further but headless Chrome is known for sometimes causing different behaviors

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

TESTFILES=$(circleci tests glob "tests/selenium/**/test_*.py" | circleci tests split --split-by=timings)
pytest --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
- store_artifacts:
path: test-reports
- store_test_results:
path: test-reports
- store_artifacts:
path: /tmp/dash_artifacts

"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

@Marc-Andre-RivetMarc-Andre-RivetMar 19, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The 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
Expand All@@ -159,34 +115,27 @@ 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

command: python -m venv 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: |
Expand All@@ -200,6 +149,8 @@ workflows:
jobs:
- "node"
- "server-test"
- "standalone-test"
- "unit-test"
- "visual-test"
- percy-finalize:
requires:
- server-test
12 changes: 0 additions & 12 deletions .config/tslint.json

This file was deleted.

13 changes: 7 additions & 6 deletions .config/webpack/base.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,6 @@ module.exports = (options = {}) => {
mode: mode,
output: {
path: path.resolve(__dirname, `./../../${dashLibraryName}`),
chunkFilename: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5 -- see optimization section

filename: '[name].js',
library: dashLibraryName,
libraryTarget: 'window'
Expand All@@ -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)[\\\/]/,

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d3-format v2 is now bundled in ES6, we need to transpile it to ES5 for our IE11 support.

use: [
{ loader: 'babel-loader', options: babel },
{ loader: 'ts-loader', options: ts },
Expand All@@ -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 }
]
Expand DownExpand Up@@ -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'),
Expand All@@ -108,7 +109,7 @@ module.exports = (options = {}) => {
optimization: {
splitChunks: {
chunks: 'async',
name: true,
name: '[name].js',

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from Wepback4 -> 5

cacheGroups: {
async: {
chunks: 'async',
Expand Down
59 changes: 59 additions & 0 deletions .eslintrc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": "./tsconfig.lint.json"
},
"rules": {
"arrow-parens": [
2,
"as-needed"
],
"comma-dangle": [
2,
"never"
],
"no-unused-expressions": 2,
"no-unused-vars": 0,
"prefer-arrow-callback": 2,
"quote-props": [
2,
"as-needed"
],
"quotes": [
2,
"single",
{ "avoidEscape": true }
],
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/array-type": 0,
"@typescript-eslint/eofline": 0,
"@typescript-eslint/max-classes-per-file": 0,
"@typescript-eslint/max-line-length": 0,
"@typescript-eslint/member-access": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/no-conditional-assignment": 0,
"@typescript-eslint/no-empty": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "_" }],
"@typescript-eslint/object-literal-sort-keys": 0,
"@typescript-eslint/object-literal-shorthand": 0,
"@typescript-eslint/ordered-imports": 0,
"@typescript-eslint/prefer-const": 0,
"@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/space-before-function-paren": [
0,
"always"
],
"@typescript-eslint/unified-signatures": 0,
"@typescript-eslint/variable-name": 0
}
}
2 changes: 1 addition & 1 deletion .flake8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flask / Black spacing and trailing ,, deactivating in Flask and respecting Black formatting instead

select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
1 change: 0 additions & 1 deletion .gitignore
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,6 @@ Project.toml

# testing
/coverage
/tests/cypress/screenshots/**
/storybook-static/**

# misc
Expand Down
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,13 +12,17 @@ const baseConfig = require('./../.config/webpack/base.js')({
});

module.exports = {
core: { builder: 'webpack5' },
stories: ['./../tests/visual/percy-storybook/**/*.percy.tsx'],
webpackFinal: async (config, { configType }) => {
// jerry rig everything
config.resolve.alias.core = path.resolve(__dirname, './../src/core'),
config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

config.module = baseConfig.module;
config.stats = {
warnings: true
};

return config;
}
Expand Down
10 changes: 0 additions & 10 deletions cypress.json

This file was deleted.

Loading