-
Notifications
You must be signed in to change notification settings - Fork 3
Automasted testing for plots from ControlSystems #2
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
Comments
Testing plotting automatically is very hard. Updates to the plot packages might cause very small changes in the plots by, e.g., shifting margins, axes etc. by a few points. Being robust against these small changes while detecting meaningful differences between plots is a hard problem that is still an active research area. Simply doing I can imagine that an approach based on optimal transport would handle this very well, but it still remains troublesome. Optimal transport is computationally expensive, and threshold values are still required to be set somehow. |
We are using VisualRegressionTests for comparison here, but I am not sure how well it is doing. I think a nice solution would be that this package monitors pull requests to ControlSystems.jl, runs the tests and posts the status with links to comparisons on the original pull request automatically. I don't know if this is possible with for example the github actions. |
This should already happen when running this package, if it still works. The way it used to work was that it ran the set of examples and compared the images to the saved ones. If there was a significant difference, the package would ask if the reference should be replaced with the new one. |
|
I have been looking into it a bit, and it seems like it should be possible as an action on the ControlSystems.jl repo. For example, adding a trigger:
works fine, see my run on mfalt/ControlSystems.jl#2
The juliascript would look something like this https://gist.github.com/mfalt/58e9ad8bb38041cd98801e6ae65d8188 |
If its is possible to add a |
Ok, this seems entirely doable, I registered a bot that can get access to ControlExamplePlots, and I am able to send a message from ControlSystems.jl that triggers an action on ControlExamplePlots.jl, and verify that is is sent by the bot. The bot would then only need access to post comments on ControlSystems.jl. I will see if i can finalize this over the weekend. What do you think @baggepinnen ? |
Sounds like it's worth a try. I was working on a transport-based distance between images earlier today but did not have time to finish it. Could potentially be useful to make distance computations more robust. In the meantime, there's also the package https://github.com/JuliaImages/ImageQualityIndexes.jl |
I have it up and running now! (on my own fork to not mess something up). The result can be seen here (i had to close and open once because I had a bug in the bot): Edit: The bot only has access to ControlExamplePlots.jl as a collaborator. I guess this could be circumvented by making it push to its own fork. But I think the security is pretty good. It works by having a secret token for the bot stored in the settings for ControlExamplePlots.jl repo. |
Closing since we have implemented this now. Thanks for helping us out with ideas. If you have any suggestions on how to improve the current implementation, feel free to comment on #8 |
I was encouraged to find a solution to automate testing for the plotting in ControlSystems.jl
I have thought about the best way to achieve this. The only way i could come up with is committing pictures of plots to this package which seems a bit dubious to me. (You should commit binaries into git)
This approach also carries the human cost that the plots (and the package) might need to be rerun after every update.
Can i have your thoughts on that?
The text was updated successfully, but these errors were encountered: