Skip to content
Merged
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
19 changes: 2 additions & 17 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
version:
- '1.10'
- '1'
os:
- ubuntu-latest
arch:
- x64
uses: "SciML/.github/.github/workflows/tests.yml@v1"
with:
julia-version: ${{ matrix.version }}
julia-arch: ${{ matrix.arch }}
os: ${{ matrix.os }}
tests:
uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1"
secrets: "inherit"
docs:
name: Documentation
Expand Down
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ LocalRegistry = "0.5"
SnoopCompileCore = "3"
Statistics = "1"
TOML = "1"
Test = "1"
YAML = "0.4"
julia = "1.10"

Expand Down
28 changes: 17 additions & 11 deletions test/jet_tests.jl → test/qa.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
# JET.jl static analysis tests
# These tests verify type stability and catch potential runtime errors
# QA group: Aqua.jl project-quality checks and JET.jl static analysis.
# 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

@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

@testset "JET static analysis" begin
@testset "Project utilities" begin
# Test type stability of project utility functions
@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
# Create a temporary test file
mktempdir() do tmpdir
test_file = joinpath(tmpdir, "test.jl")
write(
Expand All @@ -28,26 +41,21 @@ using JET
"""
)

# Test that find_version_checks_in_file is type stable
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_version_checks_in_file(
test_file
)
end

# Test find_version_checks_in_repo with the current directory
# Note: This may have some issues from dependencies, so we use target_modules
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_version_checks_in_repo(".")
end

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

@testset "Struct constructors" begin
# Test that struct constructors are type stable
@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(
Expand All @@ -56,9 +64,7 @@ using JET
end

@testset "Report functions" begin
# Test VersionCheck related functions
checks = OrgMaintenanceScripts.VersionCheck[]
# Test the IO method directly for type stability
@test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.print_version_check_summary(
devnull, checks
)
Expand Down
15 changes: 15 additions & 0 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
OrgMaintenanceScripts = "87d49508-7ad8-40c6-ae47-b3ac92269cd4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

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

[sources]
OrgMaintenanceScripts = {path = "../.."}
20 changes: 15 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
using Pkg
using OrgMaintenanceScripts
using Test
using TOML
using Dates

@testset "OrgMaintenanceScripts.jl" begin
@testset "Version bumping" begin
const GROUP = get(ENV, "GROUP", "All")

if GROUP == "QA"
Pkg.activate(joinpath(@__DIR__, "qa"))
Pkg.develop(PackageSpec(path = joinpath(@__DIR__, "..")))
Pkg.instantiate()
include("qa.jl")
end

if GROUP == "All" || GROUP == "Core"
@testset "OrgMaintenanceScripts.jl" begin
@testset "Version bumping" begin
# Test bump_minor_version
@test OrgMaintenanceScripts.bump_minor_version("1.2.3") == "1.3.0"
@test OrgMaintenanceScripts.bump_minor_version("0.1.0") == "0.2.0"
Expand Down Expand Up @@ -134,7 +145,6 @@ using Dates
# Temporarily commented out due to syntax error in multiprocess_testing.jl
# include("multiprocess_testing_tests.jl")
include("documentation_cleanup_tests.jl")
# JET tests are available for manual static analysis but not included in CI
# To run JET analysis manually: julia --project=. -e 'using JET; include("test/jet_tests.jl")'
# include("jet_tests.jl")
# JET/Aqua static analysis runs in the QA group (GROUP=QA -> test/qa.jl).
end
end
12 changes: 12 additions & 0 deletions test/test_groups.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Root test-group matrix for OrgMaintenanceScripts.jl, consumed by the canonical
# grouped-tests.yml@v1 reusable workflow (see .github/workflows/CI.yml). Each
# group runs on every Julia version it lists. runtests.jl dispatches on GROUP.
#
# Core reproduces the previous CI matrix (Julia 1.10 == "lts", and "1").
# QA runs Aqua/JET static analysis in an isolated environment (test/qa).

[Core]
versions = ["lts", "1"]

[QA]
versions = ["lts", "1"]
Loading