Skip to content

Commit

Permalink
suppress model-generated warnings in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed May 9, 2024
1 parent a719bd3 commit 18ba90f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ PartitionedLS = "19f41c5e-8610-11e9-2f2a-0d67e7c5027f"
SIRUS = "cdeec39e-fb35-4959-aadb-a1dd5dede958"
SelfOrganizingMaps = "ba4b7379-301a-4be0-bee6-171e4e152787"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
SymbolicRegression = "8254be44-1295-4e6a-a16d-46603ac705cb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["BetaML", "CatBoost", "EvoLinear", "EvoTrees", "Imbalance", "InteractiveUtils", "LightGBM", "MLJClusteringInterface", "MLJDecisionTreeInterface", "MLJFlux", "MLJGLMInterface", "MLJLIBSVMInterface", "MLJLinearModels", "MLJMultivariateStatsInterface", "MLJNaiveBayesInterface", "MLJScikitLearnInterface", "MLJTSVDInterface", "MLJTestInterface", "MLJTestIntegration", "MLJText", "MLJXGBoostInterface", "Markdown", "NearestNeighborModels", "OneRule", "OutlierDetectionNeighbors", "OutlierDetectionPython", "ParallelKMeans", "PartialLeastSquaresRegressor", "PartitionedLS", "SelfOrganizingMaps", "SIRUS", "SymbolicRegression", "StableRNGs", "Test"]
test = ["BetaML", "CatBoost", "EvoLinear", "EvoTrees", "Imbalance", "InteractiveUtils", "LightGBM", "MLJClusteringInterface", "MLJDecisionTreeInterface", "MLJFlux", "MLJGLMInterface", "MLJLIBSVMInterface", "MLJLinearModels", "MLJMultivariateStatsInterface", "MLJNaiveBayesInterface", "MLJScikitLearnInterface", "MLJTSVDInterface", "MLJTestInterface", "MLJTestIntegration", "MLJText", "MLJXGBoostInterface", "Markdown", "NearestNeighborModels", "OneRule", "OutlierDetectionNeighbors", "OutlierDetectionPython", "ParallelKMeans", "PartialLeastSquaresRegressor", "PartitionedLS", "SelfOrganizingMaps", "SIRUS", "SymbolicRegression", "StableRNGs", "Suppressor","Test"]
18 changes: 15 additions & 3 deletions test/integration.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using MLJTestIntegration, MLJModels, MLJ, Test, Markdown
import MLJTestIntegration as MTI
import Pkg.TOML as TOML
using Suppressor

const JULIA_TEST_LEVEL = 4
const OTHER_TEST_LEVEL = 3
Expand Down Expand Up @@ -47,7 +48,7 @@ FILTER_GIVEN_ISSUE = Dict(

# # LOG OUTSTANDING ISSUES TO STDOUT

const MODELS= models();
const MODELS = models();
const JULIA_MODELS = filter(m->m.is_pure_julia, MODELS);
const OTHER_MODELS = setdiff(MODELS, JULIA_MODELS);

Expand Down Expand Up @@ -178,6 +179,8 @@ MLJTestIntegration.test(MODELS, (nothing, ), level=1, throw=true, verbosity=0);

# # JULIA TESTS

problems = []

options = (
level = JULIA_TEST_LEVEL,
verbosity = 0, # bump to 2 to debug
Expand All @@ -192,7 +195,9 @@ options = (
model in EXCLUDED_BY_ISSUE && continue

print("\rTesting $(model.name) ($(model.package_name)) ")
@test isempty(MLJTestIntegration.test(model; mod=@__MODULE__, options...))
okay =
@suppress isempty(MLJTestIntegration.test(model; mod=@__MODULE__, options...))
okay || push!(problems, model)
end
end

Expand All @@ -213,8 +218,15 @@ options = (
model in EXCLUDED_BY_ISSUE && continue

print("\rTesting $(model.name) ($(model.package_name)) ")
@test isempty(MLJTestIntegration.test(model; mod=@__MODULE__, options...))
okay =
@suppress isempty(MLJTestIntegration.test(model; mod=@__MODULE__, options...))
okay || push!(problems, model)
end
end

okay = isempty(problems)
okay || println("Integration tests failed for these models: \n $problems")

@test okay

true

0 comments on commit 18ba90f

Please sign in to comment.