Skip to content

Commit

Permalink
Registry consistency tests: For every version, check that each compat…
Browse files Browse the repository at this point in the history
… entry has a corresponding deps entry
  • Loading branch information
DilumAluthge authored Oct 28, 2023
1 parent 3082b39 commit 2dae7e7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/registry_testing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
# Compat.toml testing
compatfile = abspath(data["path"], "Compat.toml")
if isfile(compatfile)
# If Compat.toml exists, Deps.toml must exist.
Test.@test isfile(depsfile)

compat = Pkg.TOML.parsefile(compatfile)
# Test that all names with compat is a dependency
compatnames = Set{String}(x for (_, d) in compat for (x, _) in d)
Expand Down Expand Up @@ -233,6 +236,22 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
else
@debug "Compat.toml file does not exist" compatfile
end

# https://github.com/JuliaRegistries/RegistryCI.jl/issues/522
# For every version, each compat entry has a corresponding deps entry.
if isfile(compatfile)
compat_uncompressed = RegistryTools.Compress.load(compatfile)
deps_uncompressed = isfile(depsfile) ? RegistryTools.Compress.load(depsfile) : Dict()
for v in keys(vers)
compat_for_this_v = get(compat_uncompressed, v, Dict())
deps_for_this_v = get(deps_uncompressed, v, Dict())
Test.@test compat_for_this_v isa AbstractDict
Test.@test deps_for_this_v isa AbstractDict
for compat_pkgname in keys(compat_for_this_v)
@test haskey(deps_for_this_v, compat_pkgname)
end
end
end
end
# Make sure all paths are unique
path_parts = [splitpath(data["path"]) for (_, data) in reg["packages"]]
Expand Down

0 comments on commit 2dae7e7

Please sign in to comment.