Skip to content

Commit

Permalink
test: first order tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 30, 2024
1 parent 52a2387 commit df06103
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 3 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/CI_NonlinearSolveFirstOrder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI (NonlinearSolveFirstOrder)

on:
pull_request:
branches:
- master
paths:
- "lib/NonlinearSolveFirstOrder/**"
- ".github/workflows/CI_NonlinearSolveFirstOrder.yml"
- "lib/NonlinearSolveBase/**"
- "lib/SciMLJacobianOperators/**"
push:
branches:
- master

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- "lts"
- "1"
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: "Install Dependencies and Run Tests"
run: |
import Pkg
Pkg.Registry.update()
# Install packages present in subdirectories
dev_pks = Pkg.PackageSpec[]
for path in ("lib/SciMLJacobianOperators", "lib/NonlinearSolveBase")
push!(dev_pks, Pkg.PackageSpec(; path))
end
Pkg.develop(dev_pks)
Pkg.instantiate()
Pkg.test(; coverage="user")
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=lib/NonlinearSolveFirstOrder {0}
- uses: julia-actions/julia-processcoverage@v1
with:
directories: lib/NonlinearSolveFirstOrder/src,lib/NonlinearSolveBase/src,lib/NonlinearSolveBase/ext,lib/SciMLJacobianOperators/src
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
fail_ci_if_error: true
15 changes: 13 additions & 2 deletions lib/NonlinearSolveFirstOrder/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,19 @@ StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
ADTypes = "1.9.0"
Aqua = "0.8"
ArrayInterface = "7.16.0"
BenchmarkTools = "1.5.0"
CommonSolve = "0.2.4"
ConcreteStructs = "0.2.3"
DiffEqBase = "6.155.3"
Enzyme = "0.13.12"
ExplicitImports = "1.5"
FiniteDiff = "2.26.0"
ForwardDiff = "0.10.36"
Hwloc = "3"
InteractiveUtils = "<0.0.1, 1"
LineSearch = "0.1.4"
LinearAlgebra = "1.11.0"
LineSearches = "7.3.0"
LinearAlgebra = "1.10"
LinearSolve = "2.36.1"
MaybeInplace = "0.1.4"
NonlinearProblemLibrary = "0.1.2"
Expand All @@ -46,22 +49,30 @@ PrecompileTools = "1.2"
ReTestItems = "1.24"
Reexport = "1"
SciMLBase = "2.54"
SciMLJacobianOperators = "0.1.0"
Setfield = "1.1.1"
StableRNGs = "1"
StaticArrays = "1.9.8"
StaticArraysCore = "1.4.3"
Test = "1.10"
Zygote = "0.6.72"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
Hwloc = "0e44f5e4-bd66-52a0-8798-143a42290a1d"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
NonlinearProblemLibrary = "b7050fa9-e91f-4b37-bcee-a89a063da141"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["Aqua", "ExplicitImports", "Hwloc", "InteractiveUtils", "NonlinearProblemLibrary", "Pkg", "ReTestItems", "StableRNGs", "Test"]
test = ["Aqua", "BenchmarkTools", "Enzyme", "ExplicitImports", "Hwloc", "InteractiveUtils", "LineSearches", "NonlinearProblemLibrary", "Pkg", "ReTestItems", "StableRNGs", "StaticArrays", "Test", "Zygote"]
Empty file.
Empty file.
22 changes: 22 additions & 0 deletions lib/NonlinearSolveFirstOrder/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
using ReTestItems, NonlinearSolveFirstOrder, Hwloc, InteractiveUtils, Pkg

@info sprint(InteractiveUtils.versioninfo)

const GROUP = lowercase(get(ENV, "GROUP", "All"))

const RETESTITEMS_NWORKERS = parse(
Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 4)))
)
const RETESTITEMS_NWORKER_THREADS = parse(Int,
get(
ENV, "RETESTITEMS_NWORKER_THREADS",
string(max(Hwloc.num_virtual_cores() ÷ RETESTITEMS_NWORKERS, 1))
)
)

@info "Running tests for group: $(GROUP) with $(RETESTITEMS_NWORKERS) workers"

ReTestItems.runtests(
NonlinearSolveFirstOrder; tags = (GROUP == "all" ? nothing : [Symbol(GROUP)]),
nworkers = RETESTITEMS_NWORKERS, nworker_threads = RETESTITEMS_NWORKER_THREADS,
testitem_timeout = 3600
)
2 changes: 1 addition & 1 deletion lib/NonlinearSolveQuasiNewton/test/core_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ end
cache = init(
NonlinearProblem{false}(quadratic_f, u0, 2.0), solver, abstol = 1e-9
)
@test (@ballocated solve!($cache)) 320
@test (@ballocated solve!($cache)) 400
end

@testset "[IIP] u0: $(typeof(u0))" for u0 in (ones(32),)
Expand Down

0 comments on commit df06103

Please sign in to comment.