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

Test Dash table against head of master and release-v1 #309

Merged
merged 10 commits into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
115 changes: 96 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

jobs:
"test":
"test-v0":
docker:
- image: circleci/python:3.6-node-browsers
- image: cypress/base:10
Expand Down Expand Up @@ -33,12 +33,60 @@ jobs:
name: Install requirements
command: |
. venv/bin/activate
pip install -r requirements.txt --quiet
pip install -r requirements-base.txt --quiet
pip install -r requirements-v0.txt --quiet

- run:
name: Run build:js
command: npm run private::build:js-test

- run:
name: Run build:py
command: |
. venv/bin/activate
npm run private::build:py

- run:
name: Run tests
command: |
. venv/bin/activate
npm run test-v0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

test v0 stuff -- we only run server tests



"test-v1":
docker:
- image: circleci/python:3.6-node-browsers
- image: cypress/base:10

steps:
- checkout
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
- run:
name: Install npm packages
command: npm install
- run:
name: Cypress Install
command: |
$(npm bin)/cypress install

- save_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
key: deps1-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- "venv"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not keeping the venv in cache to make sure the latest is installed from git ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

- node_modules
- /home/circleci/.cache/Cypress

- run:
name: Create virtualenv
command: |
python3 -m venv venv

- run:
name: Install requirements
command: |
. venv/bin/activate
pip install -r requirements-base.txt --quiet
pip install -r requirements-v1.txt --quiet

- run:
name: Run build:js
Expand All @@ -54,7 +102,7 @@ jobs:
name: Run tests
command: |
. venv/bin/activate
npm run test
npm run test-v1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for v1 we run everything (server, standalone w/ React 16, unit tests)



"visual-test":
Expand Down Expand Up @@ -110,24 +158,21 @@ jobs:
when: always


"python-3.6":
"python-3.6-v0":
docker:
- image: circleci/python:3.6-stretch-browsers

environment:
PERCY_ENABLED: True
PERCY_PROJECT: plotly/dash-table-python
PERCY_PROJECT: plotly/dash-table-python-v0

steps:
- checkout

- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_PYTHON_TOKEN"' >> $BASH_ENV

- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
echo 'export PERCY_TOKEN="$PERCY_PYTHON_TOKEN_V0"' >> $BASH_ENV
Copy link
Contributor Author

Choose a reason for hiding this comment

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


- run:
name: Create virtualenv
Expand All @@ -138,12 +183,8 @@ jobs:
name: Install requirements
command: |
. venv/bin/activate
pip install -r requirements.txt --quiet

- save_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
paths:
- "venv"
pip install -r requirements-base.txt --quiet
pip install -r requirements-v0.txt --quiet

- run:
name: Run integration tests
Expand All @@ -152,12 +193,48 @@ jobs:
python -m unittest tests.dash.test_integration


"python-3.6-v1":
docker:
- image: circleci/python:3.6-stretch-browsers

environment:
PERCY_ENABLED: True
PERCY_PROJECT: plotly/dash-table-python-v1

steps:
- checkout

- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_PYTHON_TOKEN_V1"' >> $BASH_ENV

- run:
name: Create virtualenv
command: |
python3 -m venv venv

- run:
name: Install requirements
command: |
. venv/bin/activate
pip install -r requirements-base.txt --quiet
pip install -r requirements-v1.txt --quiet

- run:
name: Run integration tests
command: |
. venv/bin/activate
python -m unittest tests.dash.test_integration


workflows:
version: 2
build:
jobs:
- "python-3.6"
- "python-3.6-v0"
- "python-3.6-v1"
- "node"
- "test"
- "test-v0"
- "test-v1"
- "visual-test"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Maintenance
- Test with head of both Dash v0.x and Dash v1.x [#20](https://github.com/plotly/dash-core/issues/20)

## [3.1.11] - 2018-12-10
### Fixed
- Selection, navigation, copy from readonly cell [#276](https://github.com/plotly/dash-table/issues/276)
Expand Down
6 changes: 4 additions & 2 deletions dash_table/package-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
"private::wait_dash8083": "wait-on http://localhost:8083",
"private::wait_js": "wait-on http://localhost:8080",
"private::opentests": "cypress open",
"private::runtests": "cypress run --browser chrome",
"private::runtests-v0": "cypress run --browser chrome --spec 'tests/cypress/tests/server/**/*'",
"private::runtests-v1": "cypress run --browser chrome",
"build.watch": "webpack-dev-server --content-base dash_table --mode development",
"build": "run-s private::build:js private::build:py",
"lint": "tslint '{src,demo,tests}/**/*.{js,ts,tsx}' --exclude '**/@Types/*.*'",
"test": "run-p --race private::host* private::runtests",
"test-v0": "run-p --race private::host* private::runtests-v0",
"test-v1": "run-p --race private::host* private::runtests-v1",
"test.visual": "build-storybook && percy-storybook",
"test.visual-local": "build-storybook",
"test.watch": "run-p --race \"private::build:js-test-watch\" --race private::host* private::opentests"
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
"private::wait_dash8083": "wait-on http://localhost:8083",
"private::wait_js": "wait-on http://localhost:8080",
"private::opentests": "cypress open",
"private::runtests": "cypress run --browser chrome",
"private::runtests-v0": "cypress run --browser chrome --spec 'tests/cypress/tests/server/**/*'",
"private::runtests-v1": "cypress run --browser chrome",
"build.watch": "webpack-dev-server --content-base dash_table --mode development",
"build": "run-s private::build:js private::build:py",
"lint": "tslint '{src,demo,tests}/**/*.{js,ts,tsx}' --exclude '**/@Types/*.*'",
"test": "run-p --race private::host* private::runtests",
"test-v0": "run-p --race private::host* private::runtests-v0",
"test-v1": "run-p --race private::host* private::runtests-v1",
"test.visual": "build-storybook && percy-storybook",
"test.visual-local": "build-storybook",
"test.watch": "run-p --race \"private::build:js-test-watch\" --race private::host* private::opentests"
Expand Down
56 changes: 56 additions & 0 deletions requirements-base.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
appdirs==1.4.3
appnope==0.1.0
astroid==2.0.4
attrs==18.2.0
backcall==0.1.0
black==18.6b4
certifi==2018.8.24
chardet==3.0.4
chromedriver-binary==2.41.0
click==6.7
decorator==4.3.0
flake8==3.5.0
Flask==1.0.2
Flask-Compress==1.4.0
gunicorn==19.9.0
idna==2.7
ipdb==0.11
ipython==6.5.0
ipython-genutils==0.2.0
isort==4.3.4
itsdangerous==0.24
jedi==0.12.1
Jinja2==2.10
jsonschema==2.6.0
jupyter-core==4.4.0
lazy-object-proxy==1.3.1
MarkupSafe==1.0
mccabe==0.6.1
nbformat==4.4.0
numpy==1.15.1
pandas==0.23.4
parso==0.3.1
percy==2.0.0
pexpect==4.6.0
pickleshare==0.7.4
plotly==3.2.1
prompt-toolkit==1.0.15
ptyprocess==0.6.0
pycodestyle==2.3.1
pyflakes==1.6.0
Pygments==2.2.0
pylint==2.1.1
python-dateutil==2.7.3
pytz==2018.5
requests==2.19.1
retrying==1.3.3
selenium==3.14.0
simplegeneric==0.8.1
six==1.11.0
toml==0.9.6
traitlets==4.3.2
typed-ast==1.1.0
urllib3==1.23
wcwidth==0.1.7
Werkzeug==0.14.1
wrapt==1.10.11
4 changes: 4 additions & 0 deletions requirements-v0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
git+git://github.com/plotly/dash@master#egg=dash
git+git://github.com/plotly/dash-core-components@master#egg=dash_core_components
git+git://github.com/plotly/dash-html-components@master#egg=dash_html_components
git+git://github.com/plotly/dash-renderer@master#egg=dash_renderer
4 changes: 4 additions & 0 deletions requirements-v1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
git+git://github.com/plotly/dash@release-v1#egg=dash
git+git://github.com/plotly/dash-core-components@release-v1#egg=dash_core_components
git+git://github.com/plotly/dash-html-components@release-v1#egg=dash_html_components
git+git://github.com/plotly/dash-renderer@release-v1#egg=dash_renderer
62 changes: 2 additions & 60 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,60 +1,2 @@
appdirs==1.4.3
appnope==0.1.0
astroid==2.0.4
attrs==18.2.0
backcall==0.1.0
black==18.6b4
certifi==2018.8.24
chardet==3.0.4
chromedriver-binary==2.41.0
click==6.7
dash==0.32.0
dash-core-components==0.40.2
dash-html-components==0.13.2
dash_renderer==0.15.1
decorator==4.3.0
flake8==3.5.0
Flask==1.0.2
Flask-Compress==1.4.0
gunicorn==19.9.0
idna==2.7
ipdb==0.11
ipython==6.5.0
ipython-genutils==0.2.0
isort==4.3.4
itsdangerous==0.24
jedi==0.12.1
Jinja2==2.10
jsonschema==2.6.0
jupyter-core==4.4.0
lazy-object-proxy==1.3.1
MarkupSafe==1.0
mccabe==0.6.1
nbformat==4.4.0
numpy==1.15.1
pandas==0.23.4
parso==0.3.1
percy==2.0.0
pexpect==4.6.0
pickleshare==0.7.4
plotly==3.2.1
prompt-toolkit==1.0.15
ptyprocess==0.6.0
pycodestyle==2.3.1
pyflakes==1.6.0
Pygments==2.2.0
pylint==2.1.1
python-dateutil==2.7.3
pytz==2018.5
requests==2.19.1
retrying==1.3.3
selenium==3.14.0
simplegeneric==0.8.1
six==1.11.0
toml==0.9.6
traitlets==4.3.2
typed-ast==1.1.0
urllib3==1.23
wcwidth==0.1.7
Werkzeug==0.14.1
wrapt==1.10.11
-r requirements-base.txt
-r requirements-v1.txt
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexcjohnson So interestingly Heroku does not seem super flexible about its setup procedure. The project has been tagged as Python and as far as I understand, that means it will look for setup.py, runtime.txt and requirements.txt -- so whatever weird multi version setup we have, we must play around that limitation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Annoying, but nice solution!

5 changes: 3 additions & 2 deletions tests/dash/app_dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
ID_PREFIX = "app_dropdown"
IDS = {
"dropdown": ID_PREFIX,
"dropdown-by-cell": '{}-row-by-cell'.format(ID_PREFIX)
"dropdown-by-cell": '{}-row-by-cell'.format(ID_PREFIX),
"dropdown-by-cell-deprecated": '{}-deprecated-row-by-cell'.format(ID_PREFIX)
Copy link
Contributor Author

@Marc-Andre-Rivet Marc-Andre-Rivet Dec 19, 2018

Choose a reason for hiding this comment

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

Not certain what happened but I think the recent change to renderer (keys/ids) is responsible for the regression -- both table NotifyObserver had the same key -- apparently causing the second one to disappear from the DOM entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

release-v1 did not have this problem because the latest master changes haven't been merged in yet -- process yet to be put in place :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh interesting - that's probably going to bite us and our users a lot of places. Should we make it an exception on the Python side if you ever provide multiple components with matching id?

Copy link
Contributor

Choose a reason for hiding this comment

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

make it an exception on the Python side if you ever provide multiple components with matching id?

There is a duplicate ids check: plotly/dash#320

Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a duplicate ids check: plotly/dash#320

why wasn't that triggered here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Layout is dynamic, it doesn't work when that is the case.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah got it, didn't notice that. More reason to make a dynamic test -> plotly/dash#475 (comment)

}


Expand Down Expand Up @@ -141,7 +142,7 @@ def layout():
html.Div('This example uses a deprecated API, `dropdown_properties`.'),

dash_table.DataTable(
id=IDS['dropdown-by-cell'],
id=IDS['dropdown-by-cell-deprecated'],
data=df_per_row_dropdown.to_dict('rows'),
columns=[
{'id': c, 'name': c}
Expand Down