-
Notifications
You must be signed in to change notification settings - Fork 15
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
[do not merge] dummy commit that shows CI doesn't check validity of html files #41
base: master
Are you sure you want to change the base?
Conversation
Yes, that's indeed the case and we're aware of it. It's valid criticism of course. But given the amount of contributions to this project I didn't feel the urge to overcome my laziness in order to do something about it. About the different approaches:
Over the Christmas holidays I actually started experimenting with a different way to proof correctness of the Plotly code. My idea was to look at the Plotly schema: |
but, like the html validation approach, this won't catch all bugs; it's useful for unit-testing but not for end-to-end validation; I'm expecting this library to grow more features over time, which also means to javascript logic including things not captured by simply validating the schema verify the end result seems more robust |
Sure, this would help somewhat with approach 3. I'd be happy with that for now. I'll comment over at #43 about the subplots.
Well, if it's a proper schema and the Json is valid under it, there shouldn't be any bugs left. The question is whether the plot actually looks like intended of course. But that's only possible by verifying the end result anyways. |
i had the suspicion so I created this PR.. turns out I was right, CI doesn't check validity of html files
running this locally you'll see a black window, dev console on chrome says:
but CI is green https://travis-ci.com/timotheecour/nim-plotly/builds/98718821
so we need something smarter to avoid regressions.
doesn't have to be 100% correct, but right now it doesn't check anything beyond nim code being valid :)
I don't know much about this topic, here's off top of my head:
approach 1: html-proofer (dead end IMO)
disappointing: doesn't catch lots of errors when i insert them (catches some, but IMO it's not suitable, unless there's some magic options i haven't seen)
approach 2: selenium
haven't tried
approach 3
for each test, make browser save image displayed on screen as png, compare against groundtruth; if it differs make test fail and save images generated, uploading it somewhere, then we check visually whether new result is ok, and update groundtruth images
approach 4 (maybe simplest, in combination w approach 3 maybe)
log js console and check logs show what we expect
https://stackoverflow.com/questions/19298420/log-javascript-console-into-a-log-file-with-firefox
[EDIT] approach 5 (workaround): generate 1 image containing all plots
this mitigates downsides of current approach which opens a ton of browser tabs, consumes lots of memory, and is harder to verify:
use #43 to generate subplots in a single window, and save the image
in CI, that image can be uploaded somewhere and a human can quickly verify if it looks ok