Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ JET = "0.9, 0.10, 0.11"
JSON3 = "1"
JuliaFormatter = "2"
LocalRegistry = "0.5"
SafeTestsets = "0.1, 1"
SnoopCompileCore = "3"
Statistics = "1"
TOML = "1"
Expand All @@ -37,7 +38,8 @@ julia = "1.10"

[extras]
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["JET", "Test"]
test = ["JET", "SafeTestsets", "Test"]
3 changes: 2 additions & 1 deletion test/documentation_cleanup_tests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Note: OrgMaintenanceScripts is already loaded by runtests.jl
using OrgMaintenanceScripts
using Test

@testset "Documentation Cleanup Tests" begin

Expand Down
4 changes: 3 additions & 1 deletion test/explicit_imports_fixer_tests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Note: OrgMaintenanceScripts is already loaded by runtests.jl
using OrgMaintenanceScripts
using Test
using TOML

@testset "Explicit Imports Fixer" begin
@testset "parse_explicit_imports_output" begin
Expand Down
3 changes: 2 additions & 1 deletion test/formatting_tests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Note: OrgMaintenanceScripts is already loaded by runtests.jl
using OrgMaintenanceScripts
using Test
using Pkg

@testset "Formatting Functions" begin
Expand Down
4 changes: 3 additions & 1 deletion test/import_timing_analysis_tests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Note: OrgMaintenanceScripts is already loaded by runtests.jl
using OrgMaintenanceScripts
using Test
using Dates

@testset "Import Timing Analysis Tests" begin
# Create a simple test package structure
Expand Down
4 changes: 3 additions & 1 deletion test/invalidation_analysis_tests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Note: OrgMaintenanceScripts is already loaded by runtests.jl
using OrgMaintenanceScripts
using Test
using Dates

@testset "Invalidation Analysis Tests" begin
# Create a simple test package structure
Expand Down
3 changes: 2 additions & 1 deletion test/min_version_fixer_tests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Note: OrgMaintenanceScripts is already loaded by runtests.jl
using OrgMaintenanceScripts
using Test

@testset "Minimum Version Fixer Tests" begin
# Test helper functions
Expand Down
76 changes: 5 additions & 71 deletions test/qa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,12 @@
# Runs in the isolated test/qa environment (see test/qa/Project.toml), gated on
# GROUP == "QA" in runtests.jl.

using OrgMaintenanceScripts
using Test
using Aqua
using JET
using Dates
using SafeTestsets

@testset "Aqua quality assurance" begin
# stale_deps and deps_compat are known failing and marked @test_broken below.
# Tracked in https://github.com/SciML/OrgMaintenanceScripts.jl/issues/60
Aqua.test_all(OrgMaintenanceScripts; stale_deps = false, deps_compat = false)
# Aqua stale deps: SnoopCompileCore, YAML — tracked in https://github.com/SciML/OrgMaintenanceScripts.jl/issues/60
@test_broken false
# Aqua deps_compat: missing compat for Dates, Distributed, LibGit2, Logging, Pkg, Printf, Random — tracked in https://github.com/SciML/OrgMaintenanceScripts.jl/issues/60
@test_broken false
@safetestset "Aqua quality assurance" begin
include("qa_aqua.jl")
end

@testset "JET static analysis" begin
@testset "Project utilities" begin
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_all_project_tomls(".")
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.get_project_info("Project.toml")
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.is_subpackage(".", ".")
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.get_relative_project_path(".", ".")
end

@testset "Version check finder" begin
mktempdir() do tmpdir
test_file = joinpath(tmpdir, "test.jl")
write(
test_file, """
# Test file with version checks
@static if VERSION >= v"1.6"
# Some code for Julia 1.6+
end
if VERSION < v"1.9"
# Some code for older Julia
end
"""
)

@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_version_checks_in_file(
test_file
)
end

@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_version_checks_in_repo(".")
end

@testset "Version bumping functions" begin
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.bump_minor_version(
"1.0.0"
)
end

@testset "Struct constructors" begin
@test_opt OrgMaintenanceScripts.VersionCheck("test.jl", 1, "test line", v"1.0", "v\"1.0\"")
@test_opt OrgMaintenanceScripts.InvalidationEntry("method", "file.jl", 1, "pkg", "reason", 0, 0)
@test_opt OrgMaintenanceScripts.InvalidationReport(
"repo", 0, OrgMaintenanceScripts.InvalidationEntry[], String[], Dates.now(), "summary", String[]
)
end

@testset "Report functions" begin
checks = OrgMaintenanceScripts.VersionCheck[]
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.print_version_check_summary(
devnull, checks
)

mktempdir() do tmpdir
output_file = joinpath(tmpdir, "output.jl")
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.write_version_checks_to_script(
checks, output_file
)
end
end
@safetestset "JET static analysis" begin
include("qa_jet.jl")
end
2 changes: 2 additions & 0 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
OrgMaintenanceScripts = "87d49508-7ad8-40c6-ae47-b3ac92269cd4"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.8"
JET = "0.9, 0.10, 0.11"
SafeTestsets = "0.1, 1"
Test = "1"
julia = "1.10"

Expand Down
13 changes: 13 additions & 0 deletions test/qa_aqua.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using OrgMaintenanceScripts
using Test
using Aqua

@testset "Aqua quality assurance" begin
# stale_deps and deps_compat are known failing and marked @test_broken below.
# Tracked in https://github.com/SciML/OrgMaintenanceScripts.jl/issues/60
Aqua.test_all(OrgMaintenanceScripts; stale_deps = false, deps_compat = false)
# Aqua stale deps: SnoopCompileCore, YAML — tracked in https://github.com/SciML/OrgMaintenanceScripts.jl/issues/60
@test_broken false
# Aqua deps_compat: missing compat for Dates, Distributed, LibGit2, Logging, Pkg, Printf, Random — tracked in https://github.com/SciML/OrgMaintenanceScripts.jl/issues/60
@test_broken false
end
64 changes: 64 additions & 0 deletions test/qa_jet.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using OrgMaintenanceScripts
using Test
using JET
using Dates

@testset "JET static analysis" begin
@testset "Project utilities" begin
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_all_project_tomls(".")
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.get_project_info("Project.toml")
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.is_subpackage(".", ".")
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.get_relative_project_path(".", ".")
end

@testset "Version check finder" begin
mktempdir() do tmpdir
test_file = joinpath(tmpdir, "test.jl")
write(
test_file, """
# Test file with version checks
@static if VERSION >= v"1.6"
# Some code for Julia 1.6+
end
if VERSION < v"1.9"
# Some code for older Julia
end
"""
)

@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_version_checks_in_file(
test_file
)
end

@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_version_checks_in_repo(".")
end

@testset "Version bumping functions" begin
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.bump_minor_version(
"1.0.0"
)
end

@testset "Struct constructors" begin
@test_opt OrgMaintenanceScripts.VersionCheck("test.jl", 1, "test line", v"1.0", "v\"1.0\"")
@test_opt OrgMaintenanceScripts.InvalidationEntry("method", "file.jl", 1, "pkg", "reason", 0, 0)
@test_opt OrgMaintenanceScripts.InvalidationReport(
"repo", 0, OrgMaintenanceScripts.InvalidationEntry[], String[], Dates.now(), "summary", String[]
)
end

@testset "Report functions" begin
checks = OrgMaintenanceScripts.VersionCheck[]
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.print_version_check_summary(
devnull, checks
)

mktempdir() do tmpdir
output_file = joinpath(tmpdir, "output.jl")
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.write_version_checks_to_script(
checks, output_file
)
end
end
end
Loading
Loading