From 9da61688cd3c4771b271b4f6a751eaf2a318ae6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Fri, 9 Jun 2023 14:25:31 -0400 Subject: [PATCH 1/6] update Dockerfile - update maintainer info ;) - use `cimg/python:3.9.9-browsers`, copied from the dash `.circleci/config.yml` - install Julia 1.9.1 --- build/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index b616ce0..a02e085 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,5 +1,5 @@ -FROM circleci/python:3.7-stretch-node-browsers -MAINTAINER Ryan Patrick Kyle "ryan@plotly.com" +FROM cimg/python:3.9.9-browsers +MAINTAINER Etienne Tétreault-Pinard "code@etpinard.xyz" RUN sudo apt-get update \ && sudo apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false @@ -7,6 +7,6 @@ RUN sudo apt-get update \ RUN cd /usr/local/src \ && sudo mkdir /usr/local/src/julia \ && sudo curl -o julia.tar.gz --location --show-error \ - https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.1-linux-x86_64.tar.gz \ + https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.1-linux-x86_64.tar.gz \ && sudo tar --extract --gzip --strip 1 --directory=/usr/local/src/julia --file=julia.tar.gz \ - && sudo ln -s /usr/local/src/julia/bin/julia /usr/local/bin/julia + && sudo ln -s /usr/local/src/julia/bin/julia /usr/local/bin/julia From e80523b9037ad97d723b69d89a5b862fc30f84b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Fri, 9 Jun 2023 14:27:24 -0400 Subject: [PATCH 2/6] un-disable CircleCI tests --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8ccac48..0b8f832 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,4 +57,3 @@ workflows: build: jobs: - "test" - when: false # disable this workflow until Percy tests are functional again From 4efd8a6f9a9dfd9cc3e0137f294e92f13f5c5ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Mon, 12 Jun 2023 16:10:09 -0400 Subject: [PATCH 3/6] use `etpinard:dashjl-tests` docker image created using the `build/Dockerfile` and pushed to hub.docker.com by me. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0b8f832..67bb763 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: test: working_directory: ~/dashjl docker: - - image: plotly/julia:ci + - image: etpinard/dashjl-tests:0.3.0 auth: username: dashautomation password: $DASH_PAT_DOCKERHUB From 2fa425b9f2671cbd91907852aa375781f07255c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Mon, 12 Jun 2023 16:12:45 -0400 Subject: [PATCH 4/6] adapt CircleCI config our docker image extends from `cimg/python-3.9-browsers` which does not install the chromedriver by default, this is now done using a CircleCI "orb" --- .circleci/config.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 67bb763..392bb54 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,7 @@ -version: 2 +version: 2.1 + +orbs: + browser-tools: circleci/browser-tools@1.2.4 jobs: @@ -15,6 +18,8 @@ jobs: steps: - checkout + - browser-tools/install-browser-tools + - run: name: ℹ️ CI Context command: | @@ -37,8 +42,9 @@ jobs: command: | python -m venv venv . venv/bin/activate + pip install --upgrade pip wheel git clone --depth 1 https://github.com/plotly/dash.git -b dev dash-main - cd dash-main && pip install -e .[dev,testing] --progress-bar off && cd ~/dashjl + cd dash-main && pip install -e .[ci,dev,testing] --progress-bar off && cd .. export PATH=$PATH:/home/circleci/.local/bin/ pytest --headless --nopercyfinalize --junitxml=test-reports/dashjl.xml --percy-assets=test/assets/ test/integration/ - store_artifacts: @@ -56,4 +62,4 @@ workflows: version: 2 build: jobs: - - "test" + - test From 00535d1b297ff28cf3c6d818edb625ca49e90622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Mon, 12 Jun 2023 16:13:42 -0400 Subject: [PATCH 5/6] adapt callback integration test for HTTP v1 these didn't run since we updated our HTTP dep back in `v1.2.0` --- .../jl_callback_context/jlcbcx001_modified_response.jl | 7 ++++--- test/integration/callbacks/test_callback_context.py | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/integration/callbacks/jl_callback_context/jlcbcx001_modified_response.jl b/test/integration/callbacks/jl_callback_context/jlcbcx001_modified_response.jl index 9656105..689e5fe 100644 --- a/test/integration/callbacks/jl_callback_context/jlcbcx001_modified_response.jl +++ b/test/integration/callbacks/jl_callback_context/jlcbcx001_modified_response.jl @@ -13,10 +13,11 @@ callback!(app, ) do value cookie = HTTP.Cookie("dash_cookie", value * " - cookie") - println(String(cookie, false)) + cookie_str = HTTP.Cookies.stringify(cookie) + println(cookie_str) http_response = callback_context().response - push!(http_response.headers, "Set-Cookie"=>String(cookie, false)) + push!(http_response.headers, "Set-Cookie"=>cookie_str) return value * " - output" end -run_server(app) \ No newline at end of file +run_server(app) diff --git a/test/integration/callbacks/test_callback_context.py b/test/integration/callbacks/test_callback_context.py index c239bdc..1e0ef73 100644 --- a/test/integration/callbacks/test_callback_context.py +++ b/test/integration/callbacks/test_callback_context.py @@ -20,7 +20,7 @@ def test_jlcbcx001_modified_response(dashjl): dashjl.wait_for_text_to_equal("#output", "abcd - output") cookie = dashjl.driver.get_cookie("dash_cookie") # cookie gets json encoded - assert cookie["value"] == 'abcd - cookie' + assert cookie["value"] == '"abcd - cookie"' assert not dashjl.get_logs() @@ -34,4 +34,4 @@ def test_jlcbcx002_triggered(dashjl): dashjl.find_element("#" + btn).click() dashjl.wait_for_text_to_equal( "#output", "Just clicked {} for the {} time!".format(btn, i) - ) \ No newline at end of file + ) From 4bce937002c1f716828b8f14d208e9b2267ad6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Mon, 12 Jun 2023 16:15:43 -0400 Subject: [PATCH 6/6] bring back the percy finalize task now done using a CircleCI "orb". While the percy snapshot test still fails (fixing this will requires "approval" on percy.io), the percy snapshots now get properly uploaded to percy.io, making them available for viewing. --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 392bb54..99497ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,7 @@ version: 2.1 orbs: + percy: percy/agent@0.1.3 browser-tools: circleci/browser-tools@1.2.4 jobs: @@ -54,12 +55,11 @@ jobs: - store_artifacts: path: /tmp/dash_artifacts - - run: - name: 🦔 percy finalize - command: npx percy finalize --all - workflows: version: 2 build: jobs: - test + - percy/finalize_all: + requires: + - test