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

Bring back CI and upgrade to Julia 1.6 #136

Merged
merged 32 commits into from
Aug 18, 2021

Conversation

IanButterworth
Copy link
Contributor

@IanButterworth IanButterworth commented May 17, 2021

Progress:

Locally with the above PR, tests get to the barplot tests and fail on the @inferred because Plot is inferred, but Plot{BarplotGraphics{Real}} is returned

Fix #138
Fix #134
Close #119

@t-bltg
Copy link
Member

t-bltg commented Aug 16, 2021

Updated reference tests (needs careful review!! I just blanket updated them without understanding whether it was correct to do so)

I believe there is a change in the random sequences provided by Random (we observed this in Plots.jl), so let's use a stable rng from StableRNGs.

@IanButterworth, the corresponding PR on your branch is here: IanButterworth#1.

@IanButterworth
Copy link
Contributor Author

Great. This means the reference images need updating again? Feel free to PR that update also

@t-bltg
Copy link
Member

t-bltg commented Aug 16, 2021

Great. This means the reference images need updating again? Feel free to PR that update also

Thanks, yes, I can generate the refs images again.

Can you maybe add me as a collaborator to your fork ? That would allow me to push directly into this branch, and not annoy you with more PRs.

@IanButterworth
Copy link
Contributor Author

IanButterworth commented Aug 16, 2021

Can you maybe add me as a collaborator to your fork

done 👍🏻

@t-bltg
Copy link
Member

t-bltg commented Aug 17, 2021

@IanButterworth , I think this PR is ready. Do you mind editing your first post by adding:

Fix https://github.com/Evizero/UnicodePlots.jl/issues/138.
Fix https://github.com/Evizero/UnicodePlots.jl/issues/134.
Close https://github.com/Evizero/UnicodePlots.jl/pull/119.

for Github to link fixed issues ?

@Evizero, can you review this PR, so that we get a running CI ?

@t-bltg t-bltg mentioned this pull request Aug 17, 2021
@IanButterworth IanButterworth changed the title WIP: Attempts at fixing testing Fix CI: Move CI to GitHub Actions. Use StableRNGs. Fix reference file bugs. etc. Aug 17, 2021
Copy link
Collaborator

@johnnychen94 johnnychen94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't check the reference files. Hopefully, that's all because of the change of random generator. As long as the CI passes, I think it's good to merge.

@t-bltg
Copy link
Member

t-bltg commented Aug 17, 2021

Interesting: on 1.2 and 1.6, v = c.grid[x,row] + 1 is correct but lookup_decode[v] has different behaviors across versions.
Shouldn't be too hard to fix using the following mwe:

MWE

Copy lines 1-97 of https://github.com/Evizero/UnicodePlots.jl/blob/master/src/canvas/asciicanvas.jl in a julia repl:

1.0.5 or 1.2.0

julia> VERSION
v"1.0.5"
julia> ascii_decode[429]
'|': ASCII/Unicode U+007c (category Sm: Symbol, math)

1.6.0 or up

julia> VERSION
v"1.6.2"
julia> ascii_decode[429]
'^': ASCII/Unicode U+005E (category Sk: Symbol, modifier)

EDIT:
As I suspected, it is a Dict looping order issue, the solution is to sort before looping:

ascii_decode[0b1] = ' '
for i in 1:511
    min_dist = typemax(Int)
    min_char = ' '
    for (k, v) in sort(collect(pairs(ascii_lookup)), by=x -> x[1])
        cur_dist = count_ones(UInt16(i)  k)
        if cur_dist < min_dist
            min_dist = cur_dist
            min_char = v
        end
    end
    ascii_decode[i + 1] = min_char
end

@t-bltg t-bltg force-pushed the ib/fix_testing branch 3 times, most recently from d7e4beb to 99da575 Compare August 17, 2021 13:47
@t-bltg
Copy link
Member

t-bltg commented Aug 17, 2021

I'm getting close, now test/tst_spy.jl fails only on 1.0:

spy

@t-bltg t-bltg force-pushed the ib/fix_testing branch 3 times, most recently from 5e15a46 to 74ab597 Compare August 17, 2021 15:44
@t-bltg
Copy link
Member

t-bltg commented Aug 17, 2021

Finally, all tests pass 🎉 ! Blaming the non-stable sprand across julia minor versions 🤯.

@IanButterworth and @johnnychen94 I'll let you review this while I'm taking a ☕.

This will need another extra check of the reference images.

@t-bltg
Copy link
Member

t-bltg commented Aug 17, 2021

I've carefully visually checked all the references images using:

root="$HOME/Downloads/UnicodePlots.jl"  # fork

for f in $(find $root/test/references -name '*.txt'); do
 echo; echo
 echo "== local($f) =="
 cat $f
 echo
 url="https://raw.githubusercontent.com/Evizero/UnicodePlots.jl/master/${f#$root/}"
 echo "== remote($url) =="
 wget -q -O - $url
done

, and everything looks good (no changes apart from random numbers, as expected).

Copy link
Collaborator

@johnnychen94 johnnychen94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@t-bltg This looks great! Thank you for the detective work and bringing back CI!

Just two small comments and with that resolved I think we can merge it.

Co-authored-by: Johnny Chen <johnnychen94@hotmail.com>
@johnnychen94 johnnychen94 changed the title Fix CI: Move CI to GitHub Actions. Use StableRNGs. Fix reference file bugs. etc. Bring back CI and upgrade to Julia 1.6 Aug 18, 2021
@johnnychen94 johnnychen94 merged commit 54c97cd into JuliaPlots:master Aug 18, 2021
johnnychen94 pushed a commit that referenced this pull request Aug 18, 2021
- move from Travis/Appveyor to Github Actions
- use StableRNGs to version-agnostic random generator
- update test references with the new random seed

Co-authored-by: t-bltg <13423344+t-bltg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests fail due to Random not in Project.toml UnicodePlots.jl is failing on the daily PkgEval runs
3 participants