Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI_ecosystem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ 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:
fail-fast: false
matrix:
version:
- '1'
- '1.9'
os:
- ubuntu-latest
- macos-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI_extended.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ 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:
fail-fast: false
matrix:
version:
- '1'
- '1.9'
os:
- ubuntu-latest
- macos-latest
Expand Down
8 changes: 3 additions & 5 deletions test/examples/political_democracy/constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/examples/political_democracy/political_democracy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions test/unit_tests/multithreading.jl
Original file line number Diff line number Diff line change
@@ -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