8000 Simplify the process of creating baselines using Kaleido and improve image & other export test systems by archmoj · Pull Request #5724 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Simplify the process of creating baselines using Kaleido and improve image & other export test systems #5724

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 59 commits into from
Jun 25, 2021
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0aced42
generate baselines by new system and using kaleido
archmoj Jun 10, 2021
f166d35
provide googleFonts for image test
archmoj Jun 11, 2021
96b3d5e
provide liberation2 fonts for image test
archmoj Jun 10, 2021
9fb28a3
provide noto font for japanese and gl3d_world-cals baselines
archmoj Jun 10, 2021
71cb928
Revise exports & baseline creation and testing using Kaleido
archmoj Jun 10, 2021
0f9292c
pin down versions in export test similar to image test
archmoj Jun 11, 2021
23ff879
add info on how to draft new baselines
archmoj Jun 14, 2021
ff9b12f
remove image viewer - one could use GitHub os vs-code
archmoj Jun 14, 2021
f23e4cb
move important info on making baselines and remove fat docker readme
archmoj Jun 14, 2021
e8f3d88
remove redundant start-test_dashboard
archmoj Jun 14, 2021
0dc8a41
Merge remote-tracking branch 'origin/master' into switch-to-kaleido
archmoj Jun 15, 2021
ca18710
Update test/image/make_baseline.py
archmoj Jun 15, 2021
fe0502c
Update test/image/make_baseline.py
archmoj Jun 15, 2021
02248d4
Update test/image/make_baseline.py
archmoj Jun 15, 2021
027323e
esp > eps
archmoj Jun 15, 2021
13322c5
test eps export on ci
archmoj Jun 15, 2021
7a44a8e
simplify exclude black lists
archmoj Jun 15, 2021
b1de0bb
reduce pixelmatch threshold to 0 for non-mapbox also fail on mapbox b…
archmoj Jun 17, 2021
4a28781
Merge remote-tracking branch 'origin/master' into switch-to-kaleido
archmoj Jun 18, 2021
82b0ead
update master new baselines using kaleido
archmoj Jun 18, 2021
f0c9e24
adjust bar_show_narrow test
archmoj Jun 18, 2021
4b1b383
Revert "adjust bar_show_narrow test"
archmoj Jun 21, 2021
74853f4
do not keep liberation2 fonts on the repo
archmoj Jun 23, 2021
6522bd5
install liberation2 fonts in docker
archmoj Jun 23, 2021
1786204
do not keep NotoSerifCJK fonts on the repo 8000
archmoj Jun 23, 2021
9f705f7
install NotoSansCJK fonts in docker
archmoj Jun 23, 2021
083f9be
update japanese baseline
archmoj Jun 23, 2021
bb6abea
do not keep Raleway fonts on the repo
archmoj Jun 23, 2021
28077d1
add script to download some google fonts
archmoj Jun 23, 2021
856009e
update baselines using new Raleway fonts
archmoj Jun 23, 2021
f7f4cf1
do not keep Roboto fonts on the repo
archmoj Jun 23, 2021
21e262f
download Roboto fonts
archmoj Jun 23, 2021
9c71d22
update legend_horizontal_autowrap using new Roboto fonts
archmoj Jun 23, 2021
141e40d
do not keep PT_Sans-Narrow fonts on the repo
archmoj Jun 23, 2021
c1341fa
download PT_Sans-Narrow-Web
archmoj Jun 23, 2021
e791887
wip to download OpenSans fonts - could cause big diff
archmoj Jun 23, 2021
0c5d366
do not keep OldStandard fonts on the repo
archmoj Jun 23, 2021
d7548b1
download Old_Standar_dTT
archmoj Jun 24, 2021
09eb8fa
update baselines using new Old_Standard_TT fonts
archmoj Jun 24, 2021
2100fe9
Merge remote-tracking branch 'origin/master' into switch-to-kaleido
archmoj Jun 24, 2021
be8b865
generate baselines using new system
archmoj Jun 24, 2021
1a7461f
do not keep Droid_Sans fonts on the repo
archmoj Jun 24, 2021
1afa2fe
download NotoSans fonts instead of Driod_Sans
archmoj Jun 24, 2021
2a7071f
use NotoSans fonts instead of Driod_Sans
archmoj Jun 24, 2021
ab4b4f9
update baselines using NotoSans instead of Driod_Sans
archmoj Jun 24, 2021
8ad4a68
do not keep Droid_Serif fonts on the repo
archmoj Jun 24, 2021
3bfb395
download NotoSerif fonts instead of Driod_Serif
archmoj Jun 24, 2021
db307f6
use NotoSerif fonts instead of Driod_Serif
archmoj Jun 24, 2021
a4996d0
update baselines using NotoSerif instead of Driod_Serif
archmoj Jun 24, 2021
d1dcafb
do not keep Droid_Sans_Mono font on the repo
archmoj Jun 24, 2021
e98ce87
download NotoSansMono fonts instead of Driod_Sans_Mono
archmoj Jun 24, 2021
d65ee01
use NotoSansMono fonts instead of Driod_Sans_Mono
archmoj Jun 24, 2021
d99dd7f
update baselines using NotoSansMono instead of Driod_Sans_Mono
archmoj Jun 24, 2021
5996af1
do not keep Gravitas_One font on the repo
archmoj Jun 24, 2021
2b8d3ba
download GravitasOne
archmoj Jun 24, 2021
6a15c9e
do not keep Balto fonts on the repo
archmoj Jun 24, 2021
dd1dc35
use Roboto instead of Balto - Roboto used to be in legend_horizontal_…
archmoj Jun 24, 2021
b6a881e
update baselines using Roboto instead of Balto
archmoj Jun 24, 2021
5756afe
update CircleCi task description
archmoj Jun 24, 2021
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
Prev Previous commit
Next Next commit
add info on how to draft new baselines
  • Loading branch information
archmoj committed Jun 14, 2021
commit 23ff879418ecee53ab1ce427e5665cb64bec0f0c
28 changes: 25 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Thanks for your interest in contributing to Plotly.js! We are actively looking for
diverse contributors, with diverse background and skills.

This document outlines the general way that changes get made to this library and by whom,
and then provides specific technical information about how to set up a development
This document outlines the general way that changes get made to this library and by whom,
and then provides specific technical information about how to set up a development
environment for doing development and running tests.

## Code of Conduct
Expand All @@ -25,7 +25,7 @@ The basic architecture of Plotly.js is to accept [JSON](https://json.org/) repre
The basic process for adding new features or fixing bugs is as follows. Please note that this is a bit of an idealized outline and that things often don't proceed in a clean/linear fashion and that's ok :)

1. **Discussion** - A community member or maintainer creates an issue to discuss the use-case for the new feature. This usually entails describing the desired graphical output and discussing how close the current system can get to specifying or drawing such a figure. If the issue is perceived to be a bug, the discussion revolves around understanding how the current behaviour is incorrect or problematic, and how existing users of the system would be impacted by a change in this behaviour.
2. **Proposal** - If the current system cannot specify or draw such a figure, or if the way to do it is too onerous, a good next step would be to discuss or propose a specific change to the schema: new attributes to be added or new accepted values to new attributes, along with a prose description of the proposed drawing code. If the issue is determined to be a bug rather than a feature, the same type of proposal is required: a definition of which attributes and values will be impacted by the proposed change. A good proposal includes discussion of whether or not existing attributes can be modified rather than adding new attributes and details about which trace types or subplot types are impacted by the change. Note: sometimes community contributors skip this step and go straight to development & review (below), but going through a proposal can help speed along the review process!
2. **Proposal** - If the current system cannot specify or draw such a figure, or if the way to do it is too onerous, a good next step would be to discuss or propose a specific change to the schema: new attributes to be added or new accepted values to new attributes, along with a prose description of the proposed drawing code. If the issue is determined to be a bug rather than a feature, the same type of proposal is required: a definition of which attributes and values will be impacted by the proposed change. A good proposal includes discussion of whether or not existing attributes can be modified rather than adding new attributes and details about which trace types or subplot types are impacted by the change. Note: sometimes community contributors skip this step and go straight to development & review (below), but going through a proposal can help speed along the review process!
3. **Iteration** - The maintainers of the library or any other interested community member will then give feedback on the proposal, usually focused on consistency with the rest of the schema, and helping define a test plan to further elaborate potential edge cases.
4. **Approval** - After a number of iterations, the maintainers of the library will generally approve a proposal with an informal "this seems like something we would accept a pull request for" comment in the issue.
5. **Development** - A community member or maintainer creates a branch and makes the appropriate modifications to the code and tests and opens a pull request. This can be more or less time-consuming and challenging, depending on the nature of the change.
Expand Down Expand Up @@ -207,6 +207,28 @@ npm run test-jasmine -- --help
npm run test-jasmine -- --info
```

### Draft new baseline
Install fonts and tools
```sh
# install required fonts (if missing) on ubuntu
sudo cp -r .circleci/fonts/ /usr/share/ && sudo fc-cache -f
# upgrade pip (if needed)
python3 -m pip install --upgrade pip
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be clear re: my earlier comments - here the instructions are for local use, so using the longer python3 -m pip syntax is reasonable as a way to indicate to users that it's important to do this with Python 3 if nothing else :)

# install kaleido
python3 -m pip install kaleido
# install plotly
python3 -m pip install plotly
```

If you added new mocks to test/image/mocks folder, to generate draft baselines run
```sh
python3 test/image/make_baseline.py = mockFilename1 mockFilename2
```
Then commit the new baselines and push.
Please note that image pixel comparison tests run using circleci/python:3.8.9 docker container.
Therefore the final baselines may need updates.
This could simply be done by downloading the `baselines.tar` stored in the `ARTIFACTS` tab of `test-baselines` job (if the test failed).

### Image pixel comparison tests

Image pixel comparison tests are run in a docker container. For more
Expand Down
0