Skip to content

Commit

Permalink
Merge pull request #207 from plotly/update-docker-image-final
Browse files Browse the repository at this point in the history
Update docker image [final]
  • Loading branch information
etpinard authored Jun 12, 2023
2 parents 01621b4 + 4bce937 commit a728b5d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
23 changes: 14 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
version: 2
version: 2.1

orbs:
percy: percy/agent@0.1.3
browser-tools: circleci/browser-tools@1.2.4

jobs:

test:
working_directory: ~/dashjl
docker:
- image: plotly/julia:ci
- image: etpinard/dashjl-tests:0.3.0
auth:
username: dashautomation
password: $DASH_PAT_DOCKERHUB
Expand All @@ -15,6 +19,8 @@ jobs:
steps:
- checkout

- browser-tools/install-browser-tools

- run:
name: ℹ️ CI Context
command: |
Expand All @@ -37,8 +43,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:
Expand All @@ -48,13 +55,11 @@ jobs:
- store_artifacts:
path: /tmp/dash_artifacts

- run:
name: 🦔 percy finalize
command: npx percy finalize --all

workflows:
version: 2
build:
jobs:
- "test"
when: false # disable this workflow until Percy tests are functional again
- test
- percy/finalize_all:
requires:
- test
8 changes: 4 additions & 4 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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

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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
run_server(app)
4 changes: 2 additions & 2 deletions test/integration/callbacks/test_callback_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)
)
)

0 comments on commit a728b5d

Please sign in to comment.