From ae2a99a63795a50714cf096531c0fea9055cda22 Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Sun, 20 Sep 2026 13:36:55 -0700 Subject: [PATCH] Make the test suite runnable under Pkg.test again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Pkg.test("Query")` has been failing outright, while CI stayed green because the test-item workflow discovers test items directly and never runs runtests.jl. Two independent causes: The @pivot_wider block was still a bare @testset, left over from the test-item migration — every other block in test_standalone.jl is a @testitem. @run_package_tests only collects @testitem, so the block was never actually run by CI; its only execution was at include time from runtests.jl, where @testset is not defined because runtests.jl does not do `using Test`. Converting it to a @testitem both fixes the load error and makes the block run for the first time. It passes, and brings the suite from 38 test items to 39. The @reverse/@shuffle/@index test does `using Random`, which is not a dependency of Query and was not in the test target, so Pkg.test could not load it. This was previously masked by the @testset failure aborting the run before it was reached. Co-Authored-By: Claude Opus 5 --- Project.toml | 3 ++- test/test_standalone.jl | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 9f94ee3..6b2f6d2 100644 --- a/Project.toml +++ b/Project.toml @@ -11,6 +11,7 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [deps] DataValues = "e7dc6d0d-1eca-5fa6-8ad6-5aecde8b7ea5" @@ -20,7 +21,7 @@ IterableTables = "1c8ee90f-4401-5389-894e-7a04a3dc0f4d" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [targets] -test = ["Statistics", "Test", "DataFrames", "TypedTables", "Documenter", "IndexedTables", "Dates", "TestItemRunner"] +test = ["Statistics", "Test", "DataFrames", "TypedTables", "Documenter", "IndexedTables", "Dates", "TestItemRunner", "Random"] [compat] julia = "1.10" diff --git a/test/test_standalone.jl b/test/test_standalone.jl index cd2ccda..ef0506c 100644 --- a/test/test_standalone.jl +++ b/test/test_standalone.jl @@ -138,7 +138,10 @@ end @test result7 == result end -@testset "@pivot_wider operator" begin +@testitem "@pivot_wider operator" begin + using DataFrames + using DataValues + long = DataFrame( year = [2017, 2017, 2018, 2018], country = [:US, :EU, :US, :EU],