diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 709a0125b..2df5f8c66 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,6 +9,7 @@ jobs: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} env: + JULIA_ON_CI: true JULIA_NUM_THREADS: 8 JULIA_EXTENDED_TESTS: false strategy: diff --git a/.github/workflows/CI_ecosystem.yml b/.github/workflows/CI_ecosystem.yml index 7d13369f8..6cb852175 100644 --- a/.github/workflows/CI_ecosystem.yml +++ b/.github/workflows/CI_ecosystem.yml @@ -12,6 +12,7 @@ jobs: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} env: + JULIA_ON_CI: true JULIA_NUM_THREADS: 8 JULIA_EXTENDED_TESTS: true strategy: @@ -19,7 +20,6 @@ jobs: matrix: version: - '1' - - '1.9' os: - ubuntu-latest - macos-latest diff --git a/.github/workflows/CI_extended.yml b/.github/workflows/CI_extended.yml index dd2e5816c..308d4d09c 100644 --- a/.github/workflows/CI_extended.yml +++ b/.github/workflows/CI_extended.yml @@ -12,6 +12,7 @@ jobs: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} env: + JULIA_ON_CI: true JULIA_NUM_THREADS: 8 JULIA_EXTENDED_TESTS: true strategy: @@ -19,7 +20,6 @@ jobs: matrix: version: - '1' - - '1.9' os: - ubuntu-latest - macos-latest diff --git a/test/examples/political_democracy/constraints.jl b/test/examples/political_democracy/constraints.jl index a9bc7aa1a..b6a9477d0 100644 --- a/test/examples/political_democracy/constraints.jl +++ b/test/examples/political_democracy/constraints.jl @@ -23,11 +23,9 @@ end constrained_optimizer = SemOptimizerNLopt(; algorithm = :AUGLAG, local_algorithm = :LD_LBFGS, - local_options = Dict( - :ftol_rel => 1e-6 - ), + options = Dict(:xtol_rel => 1e-4), # equality_constraints = NLoptConstraint(;f = eq_constraint, tol = 1e-14), - inequality_constraints = NLoptConstraint(;f = ineq_constraint, tol = 0.0), + inequality_constraints = NLoptConstraint(;f = ineq_constraint, tol = 1e-8), ) model_ml_constrained = Sem( @@ -59,7 +57,7 @@ end @testset "ml_solution_constrained" begin solution_constrained = sem_fit(model_ml_constrained) - @test solution_constrained.solution[31]*solution_constrained.solution[30] >= 0.6 + @test solution_constrained.solution[31]*solution_constrained.solution[30] >= (0.6-1e-8) @test all(abs.(solution_constrained.solution) .< 10) @test solution_constrained.optimization_result.result[3] == :FTOL_REACHED skip=true @test abs(solution_constrained.minimum - 21.21) < 0.01 diff --git a/test/examples/political_democracy/political_democracy.jl b/test/examples/political_democracy/political_democracy.jl index 29b29e3d4..ed70bdb3d 100644 --- a/test/examples/political_democracy/political_democracy.jl +++ b/test/examples/political_democracy/political_democracy.jl @@ -97,7 +97,7 @@ semoptimizer = SemOptimizerOptim semoptimizer = SemOptimizerNLopt @testset "RAMMatrices | constructor | NLopt" begin include("constructor.jl") end -if ENV["JULIA_EXTENDED_TESTS"] == "true" +if !haskey(ENV, "JULIA_EXTENDED_TESTS") || ENV["JULIA_EXTENDED_TESTS"] == "true" semoptimizer = SemOptimizerOptim @testset "RAMMatrices | parts | Optim" begin include("by_parts.jl") end semoptimizer = SemOptimizerNLopt @@ -121,7 +121,7 @@ semoptimizer = SemOptimizerOptim semoptimizer = SemOptimizerNLopt @testset "RAMMatrices → ParameterTable | constructor | NLopt" begin include("constructor.jl") end -if ENV["JULIA_EXTENDED_TESTS"] == "true" +if !haskey(ENV, "JULIA_EXTENDED_TESTS") || ENV["JULIA_EXTENDED_TESTS"] == "true" semoptimizer = SemOptimizerOptim @testset "RAMMatrices → ParameterTable | parts | Optim" begin include("by_parts.jl") end semoptimizer = SemOptimizerNLopt @@ -205,7 +205,7 @@ semoptimizer = SemOptimizerOptim semoptimizer = SemOptimizerNLopt @testset "Graph → ParameterTable | constructor | NLopt" begin include("constructor.jl") end -if ENV["JULIA_EXTENDED_TESTS"] == "true" +if !haskey(ENV, "JULIA_EXTENDED_TESTS") || ENV["JULIA_EXTENDED_TESTS"] == "true" semoptimizer = SemOptimizerOptim @testset "Graph → ParameterTable | parts | Optim" begin include("by_parts.jl") end semoptimizer = SemOptimizerNLopt diff --git a/test/runtests.jl b/test/runtests.jl index 6fdda7a89..0d401ed30 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,6 +3,6 @@ using Test, SafeTestsets @time @safetestset "Unit Tests" begin include("unit_tests/unit_tests.jl") end @time @safetestset "Example Models" begin include("examples/examples.jl") end -if ENV["JULIA_EXTENDED_TESTS"] == "true" +if !haskey(ENV, "JULIA_EXTENDED_TESTS") || ENV["JULIA_EXTENDED_TESTS"] == "true" end \ No newline at end of file diff --git a/test/unit_tests/multithreading.jl b/test/unit_tests/multithreading.jl index 71da0bf2c..ba8770f19 100644 --- a/test/unit_tests/multithreading.jl +++ b/test/unit_tests/multithreading.jl @@ -1,5 +1,7 @@ using Test -@testset "multithreading_enabled" begin - @test Threads.nthreads() == 8 +if haskey(ENV, "JULIA_ON_CI") + @testset "multithreading_enabled" begin + @test Threads.nthreads() == 8 + end end \ No newline at end of file