diff --git a/.circleci/config.yml b/.circleci/config.yml index 99adb21..0ebaf73 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,10 +3,12 @@ version: 2 jobs: test: - working_directory: /root/project/Dash - + working_directory: ~/dashjl docker: - - image: julia:latest + - image: plotly/julia:ci + environment: + PERCY_PARALLEL_TOTAL: '-1' + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'True' steps: - checkout @@ -26,7 +28,28 @@ jobs: - run: name: 🔎 Unit tests command: | - julia -e 'using Pkg; Pkg.update(); Pkg.add(PackageSpec(path=pwd())); Pkg.build("Dash"); Pkg.test("Dash", coverage=true);' + julia -e 'using Pkg; Pkg.update(); Pkg.add(PackageSpec(url="https://github.com/plotly/Dash.jl.git", rev="enable-integration")); Pkg.add(PackageSpec(url="https://github.com/waralex/dash-html-components.git", rev="jl_generator_test")); Pkg.add(PackageSpec(url="https://github.com/waralex/dash-core-components.git", rev="jl_generator_test")); Pkg.build("Dash"); Pkg.build("DashHtmlComponents"); Pkg.build("DashCoreComponents"); Pkg.test("Dash", coverage=true);' + + - run: + name: ⚙️ Integration tests + command: | + python -m venv venv + . venv/bin/activate + git clone --depth 1 https://github.com/plotly/dash.git -b add-julia-runner dash-main + cd dash-main && pip install -e .[dev,testing] --progress-bar off && cd ~/dashjl + export PATH=$PATH:/home/circleci/.local/bin/ + pytest -v --log-cli-level DEBUG --nopercyfinalize --junitxml=test-reports/dashjl.xml --percy-assets=test/assets/ test/integration/ + - store_artifacts: + path: test-reports + - store_test_results: + path: test-reports + - store_artifacts: + path: /tmp/dash_artifacts + + - run: + name: 🦔 percy finalize + command: npx percy finalize --all + when: always workflows: version: 2 diff --git a/src/Dash.jl b/src/Dash.jl index e2f7504..8a80773 100644 --- a/src/Dash.jl +++ b/src/Dash.jl @@ -57,14 +57,14 @@ callback!(app, callid"graphTitle.value => graph.figure") do value ) end handle = make_handler(app, debug = true) -run_server(handle, HTTP.Sockets.localhost, 8080) +run_server(handle, HTTP.Sockets.localhost, 8050) ``` """ Dashboards """ - run_server(app::DashApp, host = HTTP.Sockets.localhost, port = 8080; debug::Bool = false) + run_server(app::DashApp, host = HTTP.Sockets.localhost, port = 8050; debug::Bool = false) Run Dash server @@ -82,11 +82,11 @@ julia> app = dash("Test") do end end julia> -julia> run_server(handler, HTTP.Sockets.localhost, 8080) +julia> run_server(handler, HTTP.Sockets.localhost, 8050) ``` """ -function run_server(app::DashApp, host = HTTP.Sockets.localhost, port = 8080; +function run_server(app::DashApp, host = HTTP.Sockets.localhost, port = 8050; debug = nothing, dev_tools_ui = nothing, dev_tools_props_check = nothing, @@ -112,9 +112,9 @@ function run_server(app::DashApp, host = HTTP.Sockets.localhost, port = 8080; dev_tools_prune_errors = dev_tools_prune_errors ) handler = make_handler(app); - @info "started" + @info string("Running on http://", host, ":", port) HTTP.serve(handler, host, port) end -end # module \ No newline at end of file +end # module diff --git a/test/integration/test_sample_app.py b/test/integration/test_sample_app.py new file mode 100644 index 0000000..2d84935 --- /dev/null +++ b/test/integration/test_sample_app.py @@ -0,0 +1,18 @@ +app = ''' +using Dash +using DashHtmlComponents + +app = dash("Test app") + +app.layout = html_div() do + html_div("Hello Dash.jl testing", id="container") +end + +run_server(app) +''' + +def test_jstr001_jl_with_string(dashjl): + dashjl.start_server(app) + dashjl.wait_for_text_to_equal( + "#container", "Hello Dash.jl testing", timeout=10 + )