Skip to content

Commit 690b938

Browse files
authored
Fix the unit tests (#150)
* Fix the unit tests * Test the linear API * Use pre-release instead of nightly in CI
1 parent e467f84 commit 690b938

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
os: macos-latest
2323
arch: arm64
2424
allow_failure: false
25-
- version: 'nightly'
25+
- version: 'pre'
2626
os: ubuntu-latest
2727
arch: x64
2828
allow_failure: true
29-
- version: 'nightly'
29+
- version: 'pre'
3030
os: macos-latest
3131
arch: x64
3232
allow_failure: true
33-
- version: 'nightly'
33+
- version: 'pre'
3434
os: windows-latest
3535
arch: x64
3636
allow_failure: true

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ QuadraticModelsQPSReaderExt = "QPSReader"
2020
[compat]
2121
LinearAlgebra = "1.10"
2222
LinearOperators = "2.3"
23-
NLPModels = "0.21.4"
23+
NLPModels = "0.21.5"
2424
NLPModelsModifiers = "0.7"
25+
QPSReader = "0.2.1"
2526
SolverCore = "0.3"
2627
SparseArrays = "1.10"
2728
SparseMatricesCOO = "0.2.3"

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1616
[compat]
1717
ADNLPModels = "0.8"
1818
LinearOperators = "2"
19-
NLPModels = "0.21.4"
19+
NLPModels = "0.21.5"
2020
NLPModelsModifiers = "0.7"
2121
NLPModelsTest = "0.10"
2222
QPSReader = "0.2"

test/test_allocations.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,32 @@ end
1111
@testset "allocs QPSData" begin
1212
for problem in qp_problems_Matrix
1313
nlp_qps = eval(Symbol(problem * "_QPSData"))()
14-
test_only_zeros(test_allocs_nlpmodels(nlp_qps))
14+
allocs = test_allocs_nlpmodels(nlp_qps; linear_api=true, exclude=[jac_op])
15+
test_only_zeros(allocs)
1516
end
1617
end
1718

1819
@testset "allocs QP_dense" begin
1920
for problem in qp_problems_Matrix
2021
nlp_qm_dense = eval(Symbol(problem * "_QP_dense"))()
21-
test_only_zeros(test_allocs_nlpmodels(nlp_qm_dense))
22+
allocs = test_allocs_nlpmodels(nlp_qm_dense; linear_api=true, exclude=[jac_op])
23+
test_only_zeros(allocs)
2224
end
2325
end
2426

2527
@testset "allocs COO QPSData" begin
2628
for problem in qp_problems_COO
2729
nlp_qps = eval(Symbol(problem * "_QPSData"))()
28-
test_only_zeros(test_allocs_nlpmodels(nlp_qps))
30+
allocs = test_allocs_nlpmodels(nlp_qps; linear_api=true, exclude=[jac_op])
31+
test_only_zeros(allocs)
2932
end
3033
end
3134

3235
@testset "allocs COO QP" begin
3336
for problem in qp_problems_COO
3437
nlp_qm_dense = eval(Symbol(problem * "_QP"))()
35-
test_only_zeros(test_allocs_nlpmodels(nlp_qm_dense))
38+
allocs = test_allocs_nlpmodels(nlp_qm_dense; linear_api=true, exclude=[jac_op])
39+
test_only_zeros(allocs)
3640
end
3741
end
3842

@@ -41,7 +45,8 @@ end
4145
nlp = eval(Symbol(problem))()
4246
x = nlp.meta.x0
4347
nlp_qm = QuadraticModel(nlp, x)
44-
test_only_zeros(test_allocs_nlpmodels(nlp_qm))
48+
allocs = test_allocs_nlpmodels(nlp_qm; linear_api=true, exclude=[jac_op])
49+
test_only_zeros(allocs)
4550
end
4651
end
4752
end

0 commit comments

Comments
 (0)