From c154b0eecf7783ab26d8a30726c1f581a11f1cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Rivet?= Date: Wed, 19 Dec 2018 17:00:22 -0500 Subject: [PATCH] Test Dash table against head of master and release-v1 (#309) --- packages/dash-table/.circleci/config.yml | 115 +++++++++++++++--- packages/dash-table/CHANGELOG.md | 4 + .../dash-table/dash_table/package-info.json | 6 +- packages/dash-table/package.json | 6 +- packages/dash-table/requirements-base.txt | 56 +++++++++ packages/dash-table/requirements-v0.txt | 4 + packages/dash-table/requirements-v1.txt | 4 + packages/dash-table/requirements.txt | 62 +--------- .../dash-table/tests/dash/app_dropdown.py | 5 +- 9 files changed, 177 insertions(+), 85 deletions(-) create mode 100644 packages/dash-table/requirements-base.txt create mode 100644 packages/dash-table/requirements-v0.txt create mode 100644 packages/dash-table/requirements-v1.txt diff --git a/packages/dash-table/.circleci/config.yml b/packages/dash-table/.circleci/config.yml index 5eb7868ac4..0a046a45b8 100644 --- a/packages/dash-table/.circleci/config.yml +++ b/packages/dash-table/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: - "test": + "test-v0": docker: - image: circleci/python:3.6-node-browsers - image: cypress/base:10 @@ -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 + + + "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" + - 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 @@ -54,7 +102,7 @@ jobs: name: Run tests command: | . venv/bin/activate - npm run test + npm run test-v1 "visual-test": @@ -110,13 +158,13 @@ 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 @@ -124,10 +172,7 @@ jobs: - 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 - run: name: Create virtualenv @@ -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 @@ -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" diff --git a/packages/dash-table/CHANGELOG.md b/packages/dash-table/CHANGELOG.md index 6a3bed4d76..c27c827e30 100644 --- a/packages/dash-table/CHANGELOG.md +++ b/packages/dash-table/CHANGELOG.md @@ -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) diff --git a/packages/dash-table/dash_table/package-info.json b/packages/dash-table/dash_table/package-info.json index 7efe1f26e8..de919a0c25 100644 --- a/packages/dash-table/dash_table/package-info.json +++ b/packages/dash-table/dash_table/package-info.json @@ -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" diff --git a/packages/dash-table/package.json b/packages/dash-table/package.json index a49c61b791..f3289c5953 100644 --- a/packages/dash-table/package.json +++ b/packages/dash-table/package.json @@ -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" diff --git a/packages/dash-table/requirements-base.txt b/packages/dash-table/requirements-base.txt new file mode 100644 index 0000000000..cba539c3f6 --- /dev/null +++ b/packages/dash-table/requirements-base.txt @@ -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 diff --git a/packages/dash-table/requirements-v0.txt b/packages/dash-table/requirements-v0.txt new file mode 100644 index 0000000000..8a978093db --- /dev/null +++ b/packages/dash-table/requirements-v0.txt @@ -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 \ No newline at end of file diff --git a/packages/dash-table/requirements-v1.txt b/packages/dash-table/requirements-v1.txt new file mode 100644 index 0000000000..5d3d4a3a7e --- /dev/null +++ b/packages/dash-table/requirements-v1.txt @@ -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 \ No newline at end of file diff --git a/packages/dash-table/requirements.txt b/packages/dash-table/requirements.txt index df0f21052d..690080fe8f 100644 --- a/packages/dash-table/requirements.txt +++ b/packages/dash-table/requirements.txt @@ -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 \ No newline at end of file diff --git a/packages/dash-table/tests/dash/app_dropdown.py b/packages/dash-table/tests/dash/app_dropdown.py index a735f0dc03..c047a13152 100644 --- a/packages/dash-table/tests/dash/app_dropdown.py +++ b/packages/dash-table/tests/dash/app_dropdown.py @@ -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) } @@ -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}