-
Notifications
You must be signed in to change notification settings - Fork 92
Add MOI versions to tests #2689
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
Comments
Yeah I realized that I stopped updating these. There are a few to fix. |
function tests_by_version(version)
root = "/Users/Oscar/.julia/dev/MathOptInterface"
dir = pwd()
cd(root)
run(`git checkout v$version`)
tests = String[]
regex = r"function (test_[a-zA-Z0-9\_]+)\("
function version_added_regex(name)
return Regex("version_added\\(\\s*?::typeof\\($name\\)")
end
for file in readdir(joinpath(root, "src", "Test"); join = true)
contents = read(file, String)
for index in findall(regex, contents)
m = match(regex, contents[index])
if match(version_added_regex(m[1]), contents) === nothing
push!(tests, m[1])
end
end
end
run(`git checkout master`)
cd(dir)
return tests
end
tags = split(
sprint(io -> run(pipeline(`git tag -l`; stdout = io))),
"\n";
keepempty = false,
) .|> VersionNumber |> sort!
filter!(v -> v >= v"1", tags)
tests = [tag => tests_by_version(tag) for tag in tags]
tests_added_by_tag = Dict{VersionNumber,Vector{String}}()
for i in 2:length(tests)
tag, list_of_tests = tests[i]
new_tests = setdiff(list_of_tests, tests[i-1][2])
if !isempty(new_tests)
tests_added_by_tag[tag] = new_tests
end
end
for tag in sort(collect(keys(tests_added_by_tag)))
println(tag)
for l in tests_added_by_tag[tag]
println(" ", l)
end
end
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
exclude_tests_after
argument inruntests
does not seem to have any impact on which tests are excluded. When usingMathOptInterface.Test.version_added
, all of the functions I checked returnv0.10.5
.For example,
but this test was added in
v1.37.2
.The text was updated successfully, but these errors were encountered: