Skip to content

Commit 7defffd

Browse files
committed
robustness: jet type-stability advisory check (52 reports baseline)
1 parent 3dee3ba commit 7defffd

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ SERVER_AVAILABLE || @info "Skipping server-dependent tests — no SurrealDB at $
5454
include("test_aqua.jl")
5555
end
5656

57+
@testset "JET" begin
58+
include("test_jet.jl")
59+
end
60+
5761
# Error parser — synthetic payloads, no network.
5862
@testset "Errors" begin
5963
include("test_errors.jl")

test/test_jet.jl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# JET.jl static type-stability check.
2+
#
3+
# JET reports calls where a type cannot be inferred (returning `Any` past a
4+
# point where it shouldn't), method-error candidates (typos, missing methods),
5+
# and other inference-time anomalies.
6+
#
7+
# We don't enforce zero reports today — Tables.jl + Dict-of-Any pervade the
8+
# codebase and produce inherently dynamic dispatches. We DO smoke-test that
9+
# JET successfully runs on the package without crashing, and surface a count
10+
# so a sudden spike in dynamic dispatches is visible in CI logs.
11+
#
12+
# When JET stabilizes around a fixed allowlist, this can become a hard
13+
# regression gate (`@test isempty(JET.get_reports(...))`).
14+
15+
using SurrealDB
16+
using JET
17+
using Test
18+
19+
@testset "JET package report (advisory)" begin
20+
# report_package walks the entire package; uses the
21+
# `concretization_patterns` default which expands constants.
22+
result = JET.report_package(SurrealDB; toplevel_logger=nothing)
23+
n = length(JET.get_reports(result))
24+
@info "JET reports" count=n
25+
# Smoke: JET ran without erroring out. The count check is intentionally
26+
# generous; tighten when the codebase is more type-stable.
27+
@test n < 200
28+
end

0 commit comments

Comments
 (0)