Skip to content

Run image tests and test-exports on new CircleCI's cimg/python new system #7471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 17, 2025
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
19 changes: 12 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,12 @@ jobs:
make-baselines-virtual-webgl:
parallelism: 8
docker:
- image: circleci/python:3.8.9
- image: cimg/python:3.12.11
working_directory: ~/plotly.js
steps:
- attach_workspace:
at: ~/
- run: sudo apt-get update
- run:
name: Install kaleido, plotly.io and required fonts
command: .circleci/env_image.sh
Expand All @@ -235,11 +236,12 @@ jobs:

make-baselines-mathjax3:
docker:
- image: circleci/python:3.8.9
- image: cimg/python:3.12.11
working_directory: ~/plotly.js
steps:
- attach_workspace:
at: ~/
- run: sudo apt-get update
- run:
name: Install kaleido, plotly.io and required fonts
command: .circleci/env_image.sh
Expand All @@ -254,11 +256,12 @@ jobs:
make-baselines:
parallelism: 12
docker:
- image: circleci/python:3.8.9
- image: cimg/python:3.12.11
working_directory: ~/plotly.js
steps:
- attach_workspace:
at: ~/
- run: sudo apt-get update
- run:
name: Install kaleido, plotly.io and required fonts
command: .circleci/env_image.sh
Expand All @@ -273,11 +276,12 @@ jobs:
make-baselines-b64:
parallelism: 12
docker:
- image: circleci/python:3.8.9
- image: cimg/python:3.12.11
working_directory: ~/plotly.js
steps:
- attach_workspace:
at: ~/
- run: sudo apt-get update
- run:
name: Install kaleido, plotly.io and required fonts
command: .circleci/env_image.sh
Expand Down Expand Up @@ -347,11 +351,12 @@ jobs:

make-exports:
docker:
- image: circleci/python:3.8.9
- image: cimg/python:3.12.11
working_directory: ~/plotly.js
steps:
- attach_workspace:
at: ~/
- run: sudo apt-get update
- run:
name: Install kaleido, plotly.io and required fonts
command: .circleci/env_image.sh
Expand All @@ -362,7 +367,7 @@ jobs:
sudo apt-get install poppler-utils
- run:
name: Create svg, jpg, jpeg, webp, pdf and eps files
command: python3 test/image/make_exports.py
command: sudo python3 test/image/make_exports.py
- persist_to_workspace:
root: ~/
paths:
Expand Down Expand Up @@ -488,7 +493,7 @@ jobs:
- store_artifacts:
path: stackgl_modules/index.js
destination: stackgl_modules/index.js

test-topojson-build:
docker:
- image: cimg/node:18.20.4
Expand Down
12 changes: 11 additions & 1 deletion .circleci/env_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@
set -e
# install required fonts
sudo apt-get install fonts-liberation2 fonts-open-sans fonts-noto-cjk fonts-noto-color-emoji

# install pip
sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3 get-pip.py

# install additional fonts
sudo python3 -m pip install requests
sudo python3 .circleci/download_google_fonts.py
sudo cp -r .circleci/fonts/ /usr/share/
sudo apt install fontconfig
sudo fc-cache -f

# install kaleido & plotly
sudo python3 -m pip install kaleido==0.2.1 plotly==5.5.0 --progress-bar off
sudo python3 -m pip install kaleido==0.2.1 plotly==6.2.0 --progress-bar off

# install numpy i.e. to convert arrays to typed arrays
sudo python3 -m pip install numpy==1.24.2
8 changes: 4 additions & 4 deletions .circleci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,24 @@ case $1 in
find $ROOT/test/image/mocks/gl* -type f -printf "%f\n"; \
find $ROOT/test/image/mocks/map* -type f -printf "%f\n"; \
} | sed 's/\.json$//1' | circleci tests split)
python3 test/image/make_baseline.py virtual-webgl $SUITE || EXIT_STATE=$?
sudo python3 test/image/make_baseline.py virtual-webgl $SUITE || EXIT_STATE=$?
exit $EXIT_STATE
;;

make-baselines-mathjax3)
python3 test/image/make_baseline.py mathjax3 legend_mathjax_title_and_items mathjax parcats_grid_subplots table_latex_multitrace_scatter table_plain_birds table_wrapped_birds ternary-mathjax ternary-mathjax-title-place-subtitle || EXIT_STATE=$?
sudo python3 test/image/make_baseline.py mathjax3 legend_mathjax_title_and_items mathjax parcats_grid_subplots table_latex_multitrace_scatter table_plain_birds table_wrapped_birds ternary-mathjax ternary-mathjax-title-place-subtitle || EXIT_STATE=$?
exit $EXIT_STATE
;;

make-baselines-b64)
SUITE=$(find $ROOT/test/image/mocks/ -type f -printf "%f\n" | sed 's/\.json$//1' | circleci tests split)
python3 test/image/make_baseline.py b64 $SUITE || EXIT_STATE=$?
sudo python3 test/image/make_baseline.py b64 $SUITE || EXIT_STATE=$?
exit $EXIT_STATE
;;

make-baselines)
SUITE=$(find $ROOT/test/image/mocks/ -type f -printf "%f\n" | sed 's/\.json$//1' | circleci tests split)
python3 test/image/make_baseline.py $SUITE || EXIT_STATE=$?
sudo python3 test/image/make_baseline.py $SUITE || EXIT_STATE=$?
exit $EXIT_STATE
;;

Expand Down
Binary file modified test/image/baselines/14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl3d_world-cals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/japanese.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/mathjax3___parcats_grid_subplots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/mathjax3___table_plain_birds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/parcats_grid_subplots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/round-worldcup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/table_latex_multitrace_scatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/table_plain_birds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/worldcup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/image/export_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var getImagePaths = require('./assets/get_image_paths');
// image formats to test
//
// N.B. 'png' is tested in `npm run test-image, no need to duplicate here
var FORMATS = ['svg', 'jpg', 'jpeg', 'webp', 'eps', 'pdf'];
var FORMATS = ['svg', 'jpg', 'jpeg', 'webp', 'pdf'];

var ONLY_FILE_SIZE = ['eps', 'pdf'];

Expand Down
2 changes: 1 addition & 1 deletion test/image/make_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
pio.templates.default = 'none'
pio.kaleido.scope.plotlyjs = os.path.join(root, 'build', 'plotly.js')

allFormats = ['svg', 'jpg', 'jpeg', 'webp', 'eps', 'pdf']
allFormats = ['svg', 'jpg', 'jpeg', 'webp', 'pdf']
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI - eps also removed in proposed #7412.

# 'png' is tested by image-test

allNames = [
Expand Down