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
32 changes: 3 additions & 29 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,6 @@ concurrency:
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }}

jobs:
test:
name: "Tests"
strategy:
fail-fast: false
matrix:
version:
- "1"
os:
- "ubuntu-latest"
- "windows-latest"
- "macOS-15-intel"
arch:
- "x64"
include:
- version: "1"
os: "macOS-latest"
arch: "aarch64"
- version: "lts"
os: "ubuntu-latest"
arch: "x64"
- version: "pre"
os: "ubuntu-latest"
arch: "x64"
uses: "SciML/.github/.github/workflows/tests.yml@v1"
with:
julia-version: ${{ matrix.version }}
julia-arch: ${{ matrix.arch }}
os: ${{ matrix.os }}
secrets: inherit
tests:
uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1"
secrets: "inherit"
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
[compat]
LinearAlgebra = "1"
NLSolversBase = "8"
Pkg = "1"
Random = "1"
StableRNGs = "1"
StackViews = "^0.1"
Expand All @@ -22,8 +23,9 @@ UnPack = "^1.0.1"
julia = "1.10"

[extras]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "StableRNGs"]
test = ["Test", "StableRNGs", "Pkg"]
15 changes: 15 additions & 0 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Evolutionary = "86b6b26d-c046-49b6-aa0b-5f0f74682bd6"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
Evolutionary = {path = "../.."}

[compat]
Aqua = "0.8"
JET = "0.9,0.10,0.11"
Test = "1"
julia = "1.10"
32 changes: 32 additions & 0 deletions test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Pkg
Pkg.activate(@__DIR__)
Pkg.develop(PackageSpec(path = joinpath(@__DIR__, "..", "..")))
Pkg.instantiate()

using Evolutionary
using Aqua
using JET
using Test

@testset "Quality Assurance" begin
@testset "Aqua" begin
# ambiguities, unbound_args and piracies currently fail; keep the
# other Aqua sub-checks running and mark the failing ones broken.
# Tracked in https://github.com/SciML/Evolutionary.jl/issues/145
Aqua.test_all(
Evolutionary;
ambiguities = false,
unbound_args = false,
piracies = false,
)
@test_broken false # Aqua ambiguities: 18 found in optimize overloads (src/api/optimize.jl) — tracked in https://github.com/SciML/Evolutionary.jl/issues/145
@test_broken false # Aqua unbound_args: 3 methods (src/api/expressions.jl) — tracked in https://github.com/SciML/Evolutionary.jl/issues/145
@test_broken false # Aqua piracies: 7 methods (Expr ops, replace, value) — tracked in https://github.com/SciML/Evolutionary.jl/issues/145
end
@testset "JET" begin
# JET.test_package reports errors (e.g. +(::Nothing,::Int) and kwcall
# on deprecated crossover/mutation aliases in src/deprecated.jl).
# Tracked in https://github.com/SciML/Evolutionary.jl/issues/145
@test_broken false # JET: report_package errors — tracked in https://github.com/SciML/Evolutionary.jl/issues/145
end
end
52 changes: 31 additions & 21 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,36 @@ using LinearAlgebra
using Statistics
using StableRNGs

# Guard against accidental piracy from `import`
@test Evolutionary.contains !== Base.contains
const GROUP = get(ENV, "GROUP", "All")

for tests in [
"types.jl",
"objective.jl",
"interface.jl",
"selections.jl",
"recombinations.jl",
"mutations.jl",
"sphere.jl",
"rosenbrock.jl",
"schwefel.jl",
"rastrigin.jl",
"n-queens.jl",
"knapsack.jl",
"onemax.jl",
"moea.jl",
"regression.jl",
"gp.jl",
]
include(tests)
# Any group other than "QA" runs the full functional suite (the matrix splits
# Core across version/OS cells only; the suite itself is the same).
if GROUP != "QA"
# Guard against accidental piracy from `import`
@test Evolutionary.contains !== Base.contains

for tests in [
"types.jl",
"objective.jl",
"interface.jl",
"selections.jl",
"recombinations.jl",
"mutations.jl",
"sphere.jl",
"rosenbrock.jl",
"schwefel.jl",
"rastrigin.jl",
"n-queens.jl",
"knapsack.jl",
"onemax.jl",
"moea.jl",
"regression.jl",
"gp.jl",
]
include(tests)
end
end

if GROUP == "QA"
include(joinpath(@__DIR__, "qa", "qa.jl"))
end
20 changes: 20 additions & 0 deletions test/test_groups.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Root test-group matrix for Evolutionary.jl, consumed by the reusable
# SciML/.github grouped-tests.yml@v1 workflow (Tests.yml is a thin caller).
#
# The functional test suite is split across two groups only to preserve the
# original Tests.yml OS/version matrix exactly: version "1" ran on all four OS
# runners, while "lts" and "pre" ran on ubuntu-latest only. Both groups run the
# same suite (runtests.jl treats every non-"QA" group as the full functional
# suite). arch is auto-detected from the runner (aarch64 on macOS-latest, x64
# elsewhere), reproducing the old per-OS arch assignment.

[Core]
versions = ["1"]
os = ["ubuntu-latest", "windows-latest", "macOS-15-intel", "macOS-latest"]

[CoreLTSPre]
versions = ["lts", "pre"]
os = ["ubuntu-latest"]

[QA]
versions = ["lts", "1"]
Loading