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

Fail test instead of erroring out when not interactive or updating #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
9 changes: 4 additions & 5 deletions src/test_reference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,13 @@ function test_reference(
""" reference = reference_path actual = actual_path

if !isinteractive() && !force_update()
error("""
@info """
To update the reference images either run the tests interactively with 'include(\"test/runtests.jl\")',
or to force-update all failing reference images set the environment variable `JULIA_REFERENCETESTS_UPDATE`
to "true" and re-run the tests via Pkg.
""")
end

if force_update() || input_bool("Replace reference with actual result?")
"""
@test false
elseif force_update() || input_bool("Replace reference with actual result?")
mv(actual_path, reference_path; force=true) # overwrite old file it
@info "Please run the tests again for any changes to take effect"
else
Expand Down
Loading