-
-
Notifications
You must be signed in to change notification settings - Fork 125
Add unit tests, setup CircleCI and Percy #35
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
Conversation
Needed to auto-generate screenshots from test_usage.py, which will be then used in test_percy_snapshot for CVI
To be broken down into different tests
Almost exhaustive test of many different types of apps, from the usage apps in root to the demos
Create a single app that generate a webpage containing all the screenshots taken in the test_usage.py. We then take a screenshot of everything using percy, and this is used to compare differences. We employ this method because it is currently impossible for percy to render canvas elements (since it directly crawls the DOM), so this is the only way to proceed
chriddyp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, this was a clever solution. Just a few small suggestions on my end.
| return "data:image/png;base64," + encoded_string.decode('ascii') | ||
|
|
||
| # Define the app | ||
| app = dash.Dash(__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chriddyp check out this multi-route app. Here I Assign the url path to return the image it represent. For example, to return "usage.png", you can visit localhost/usage.png.
chriddyp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃


About
CircleCI builds: https://circleci.com/gh/xhlulu/dash-cytoscape/tree/master
Percy build: https://percy.io/plotly/dash-cytoscape
Please note that I have already setup CircleCI on the Plotly account, I'm simply using my personal account so I can work on the PR directly while testing changes in the build. The (currently unused) build is here: https://circleci.com/gh/plotly/dash-cytoscape
Description of changes
With this PR, we will introduce 2 new test classes, namely
test_usageandtest_percy_snapshot. The former will run most of the usage apps, then save a screenshot of each.test_percy_snapshotwill then create an app containing all of those images, and take a screenshot for continuous visual integration.This PR will also update the
config.ymlin order to accomodate the new tests, as well as include tests for Python 3.7. I decided not to add support for 2.7 because of the imminent deprecation.Pre-Merge checklist
npm run build:all.Reference Issues
Closes #[issue number]
Other comments