Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Update toolchain (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Andre-Rivet authored Mar 22, 2021
1 parent e0264b7 commit 2481ac4
Show file tree
Hide file tree
Showing 149 changed files with 24,331 additions and 19,833 deletions.
107 changes: 29 additions & 78 deletions .circleci/config.yml
Original file line number Diff line number Diff 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
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

- 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":
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
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 number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module.exports = (options = {}) => {
mode: mode,
output: {
path: path.resolve(__dirname, `./../../${dashLibraryName}`),
chunkFilename: '[name].js',
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)[\\\/]/,
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 Down Expand 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',
cacheGroups: {
async: {
chunks: 'async',
Expand Down
59 changes: 59 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff 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 number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503
select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff 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 number Diff line number Diff 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

0 comments on commit 2481ac4

Please sign in to comment.