Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Nov 12, 2024
1 parent d02ad12 commit 1976ed4
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions PlotsBase/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,34 @@ using Dates
using Test

function fetch_available_versions()
buf = PipeBuffer()
pipeline(`curl https://julialang-s3.julialang.org/juliaup/DBVERSION`, stdout=buf, stderr=devnull) |> run
dbversion = readline(buf)
buf = PipeBuffer()
pipeline(`curl https://julialang-s3.julialang.org/juliaup/versiondb/versiondb-$dbversion-x86_64-unknown-linux-gnu.json`, stdout=buf, stderr=devnull) |> run
json = JSON.parse(buf)
juliaup = "https://julialang-s3.julialang.org/juliaup"
local json
for i 1:6
buf = PipeBuffer()
pipeline(`curl -s $juliaup/DBVERSION` |> ignorestatus, stdout=buf) |> run
dbversion = VersionNumber(readline(buf))
dbversion.major == 1 || continue
buf = PipeBuffer()
pipeline(`curl -s $juliaup/versiondb/versiondb-$dbversion-x86_64-unknown-linux-gnu.json` |> ignorestatus, stdout=buf) |> run
json = JSON.parse(buf)
break
sleep(10i)
end
json["AvailableChannels"]
end

function is_latest_release()
channels = fetch_available_versions()
rel = VersionNumber(split(channels["release"]["Version"], '+') |> first)
nightly = occursin("DEV", string(VERSION)) # or length(VERSION.prerelease) < 2
!nightly && VersionNumber(rel.major, rel.minor, 0, ("",)) VERSION < VersionNumber(rel.major, rel.minor + 1, 0, ("",))
!nightly && VersionNumber(rel.major, rel.minor, 0, ("",)) VERSION < VersionNumber(rel.major, rel.minor + 1, 0)
end

function is_latest_lts()
channels = fetch_available_versions()
rel = VersionNumber(split(channels["lts"]["Version"], '+') |> first)
nightly = occursin("DEV", string(VERSION)) # or length(VERSION.prerelease) < 2
!nightly && VersionNumber(rel.major, rel.minor, 0, ("",)) VERSION < VersionNumber(rel.major, rel.minor + 1, 0, ("",))
!nightly && VersionNumber(rel.major, rel.minor, 0, ("",)) VERSION < VersionNumber(rel.major, rel.minor + 1, 0)
end

is_auto() = Base.get_bool_env("VISUAL_REGRESSION_TESTS_AUTO", false)
Expand Down

0 comments on commit 1976ed4

Please sign in to comment.