Skip to content
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

reduce test stage dependency with ReferenceTests #14

Closed
wants to merge 4 commits into from

Conversation

johnnychen94
Copy link
Member

As @mgautam98 is going to improve this package with AbstractArray{<:Colorant} support ( #13 ) , I'm doing some preparation work now. This one is for the test, and I'll open a PR for CI later.

I'm still resistant to the usage of VisualRegressionTests for two reasons:

  • Even if it's a test-only dependency, VisualRegressionTests is still very large a dependency with Plots and Gtk.
  • The reference file can be very fragile because the output depends on how backends (Gtk) draw the figure. The failure in https://travis-ci.org/github/JuliaImages/ImageInpainting.jl/builds/647806320 is one such case. On the other hand, ReferenceTests only depends on image IO backend, which is quite faithful and reliable.

@juliohm Are you okay with this change?

@juliohm
Copy link
Member

juliohm commented Jul 2, 2020 via email

@johnnychen94
Copy link
Member Author

johnnychen94 commented Jul 2, 2020

It doesn't look good to me that the behavior is platform dependent. I'll investigate how it happens later today tomorrow.

@juliohm
Copy link
Member

juliohm commented Jul 2, 2020

Please go ahead and merge. The only missing feature of VisualRegressionTests.jl that I find really useful is the GUI that pops up when tests fail. It makes it easy to quickly update test data. However, I agree that the updates occur too often due to other noises related to GTK, etc.

@johnnychen94
Copy link
Member Author

The only missing feature of VisualRegressionTests.jl that I find really useful is the GUI that pops up when tests fail.

Yes, currently it displays images using ImageInTerminal, which sometimes doesn't give a clear view. There's a pending PR in ReferenceTests that renders images using ImageShow: JuliaTesting/ReferenceTests.jl#41.

That PR is pending because some mock tests are needed to detect any possible regressions. I plan to update that PR this month and then I believe you'd be satisfied.

@juliohm
Copy link
Member

juliohm commented Jul 2, 2020

Oh that is really nice. In that case I will try to get rid of VisualRegressionTests.jl in other packages as well in the future.

@juliohm
Copy link
Member

juliohm commented Jul 6, 2020

Did you finish this PR @johnnychen94 ? Please feel free to merge if it is ready. That should indeed help the other PRs being written.

@johnnychen94
Copy link
Member Author

johnnychen94 commented Jul 6, 2020

Not yet, the CI error is concerning and I'm not sure what's the cause here. It would be great if you can have a look at it since you're more familiar with the algorithm.

I'm updating ReferenceTests these days to make it more stable.

@juliohm
Copy link
Member

juliohm commented Jul 6, 2020

Of course, thank you for the heads up. Will try to take a look during the day.

@juliohm
Copy link
Member

juliohm commented Jul 6, 2020

Is it my impression or the Gray.(out) is lowering the resolution of the image?

image

image

I think it is just the image size when I plot with heatmap(out) versus visualize the real size with Gray.(out) in Juno, but just wanted to confirm. Apparently the results are making sense on this branch, but for some reason the tests with the Gray images are failing. Should we just save the *.txt of the images instead of converting back to Gray?

@juliohm
Copy link
Member

juliohm commented Jul 6, 2020

image

Also, is this information relevant? Should we set the number of CPU cores to 1 to get reproducible reference tests?

@johnnychen94
Copy link
Member Author

johnnychen94 commented Jul 20, 2020

I'm not sure if this is the same case; I just ran into a similar case that reference tests are broken when ColorVectorSpace is imported; part of the reason is the codes are not written generically to handle Array{<:Number} and Array{Gray} consistently.

I'm not 100% sure that ReferenceTests is working correctly, though.

Will try to fix it when I get some more time.

@johnnychen94 johnnychen94 marked this pull request as draft July 21, 2020 14:03
@juliohm
Copy link
Member

juliohm commented Aug 15, 2020

@johnnychen94 did you succeed in the ReferenceTests.jl side?

@johnnychen94
Copy link
Member Author

Not yet.

Unfortunately, I was quite busy this summer to continue this because of a series of day-to-day seminars. There're some unidentified bugs about its faithfully and my very limited time was spent on adding more test cases

If you have any plans on this package, please do it, I can just rebase on whatever you've done when I finally get here.

@juliohm
Copy link
Member

juliohm commented Feb 2, 2021

Solved in #22

@juliohm juliohm closed this Feb 2, 2021
@juliohm juliohm deleted the jc/reftest branch February 2, 2021 14:21
@juliohm juliohm mentioned this pull request Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants