Skip to content

Commit 5a3f480

Browse files
Fix preference tests: only print on failure, correct extension-dependent status
This commit addresses the specific feedback about the preference tests: 1. FastLUFactorization testing: Only print warnings when loading fails, not on success (since successful loading is expected behavior) 2. RFLUFactorization testing: Only print warnings when loading fails, not on success (since it's extension-dependent) 3. Clarified that RFLUFactorization is extension-dependent, not always available (requires RecursiveFactorization.jl extension) ## Changes Made ### **Silent Success, Verbose Failure** - FastLUFactorization: No print on successful loading/testing - RFLUFactorization: No print on successful loading/testing - Only print warnings when extensions fail to load or algorithms fail to work ### **Correct Extension Status** - Updated comments to clarify RFLUFactorization requires RecursiveFactorization.jl extension - Removed implication that RFLUFactorization is always available - Proper categorization: always-loaded vs extension-dependent algorithms ### **Clean Test Output** - Reduces noise in test output when extensions work correctly - Highlights only actual issues with extension loading - Maintains clear feedback about algorithm selection behavior The test now properly validates the preference system behavior with clean output that only reports issues, not expected successful behavior. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 5eda050 commit 5a3f480

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

test/preferences.jl

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,18 @@ using Preferences
6666
b = rand(Float64, 150)
6767
prob = LinearProblem(A, b)
6868

69-
# Try to load FastLapackInterface - it may or may not be available
69+
# Try to load FastLapackInterface and test FastLUFactorization
7070
try
7171
@eval using FastLapackInterface
7272

73-
# If FastLapack loads successfully, test that FastLU works
74-
try
75-
sol_fast = solve(prob, FastLUFactorization())
76-
@test sol_fast.retcode == ReturnCode.Success
77-
@test norm(A * sol_fast.u - b) < 1e-8
78-
println("✅ FastLUFactorization successfully works with extension loaded")
79-
catch e
80-
println("⚠️ FastLUFactorization not fully functional: ", e)
81-
end
73+
# Test that FastLUFactorization works - only print if it fails
74+
sol_fast = solve(prob, FastLUFactorization())
75+
@test sol_fast.retcode == ReturnCode.Success
76+
@test norm(A * sol_fast.u - b) < 1e-8
77+
# Success - no print needed
8278

8379
catch e
84-
println("ℹ️ FastLapackInterface not available in this environment: ", e)
80+
println("⚠️ FastLapackInterface/FastLUFactorization not available: ", e)
8581
end
8682

8783
# Test algorithm choice - should work regardless of FastLapack availability
@@ -104,22 +100,20 @@ using Preferences
104100
b = rand(Float64, 150)
105101
prob = LinearProblem(A, b)
106102

107-
# Try to load RecursiveFactorization - should be available as it's a dependency
103+
# Try to load RecursiveFactorization and test RFLUFactorization
108104
try
109105
@eval using RecursiveFactorization
110106

111-
# Test that RFLUFactorization works
107+
# Test that RFLUFactorization works - only print if it fails
112108
if LinearSolve.userecursivefactorization(A)
113109
sol_rf = solve(prob, RFLUFactorization())
114110
@test sol_rf.retcode == ReturnCode.Success
115111
@test norm(A * sol_rf.u - b) < 1e-8
116-
println("✅ RFLUFactorization successfully works with extension loaded")
117-
else
118-
println("ℹ️ RFLUFactorization not enabled for this matrix type")
112+
# Success - no print needed
119113
end
120114

121115
catch e
122-
println("⚠️ RecursiveFactorization loading issue: ", e)
116+
println("⚠️ RecursiveFactorization/RFLUFactorization not available: ", e)
123117
end
124118

125119
# Test algorithm choice with RecursiveFactorization available
@@ -165,13 +159,13 @@ using Preferences
165159
println("✅ AppleAccelerateLUFactorization confirmed working")
166160
end
167161

168-
# Test RFLUFactorization if available (from existing dependencies)
162+
# Test RFLUFactorization if extension is loaded (requires RecursiveFactorization.jl)
169163
if LinearSolve.userecursivefactorization(A)
170164
try
171165
sol_rf = solve(prob, RFLUFactorization())
172166
@test sol_rf.retcode == ReturnCode.Success
173167
@test norm(A * sol_rf.u - b) < 1e-8
174-
println("RFLUFactorization confirmed working")
168+
# Success - no print needed (RFLUFactorization is extension-dependent)
175169
catch e
176170
println("⚠️ RFLUFactorization issue: ", e)
177171
end

0 commit comments

Comments
 (0)