Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelize CI by splitting Unit Tests and Integration Tests on different Github actions #288

Merged
merged 13 commits into from
Jan 15, 2025
Merged
9 changes: 7 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
name: ${{ matrix.test_group }} / Julia ${{ matrix.version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.10'
- '1.11'
test_group:
- unit
- integration
os:
- ubuntu-latest
arch:
Expand All @@ -45,7 +48,7 @@ jobs:
include-all-prereleases: true
- uses: julia-actions/cache@v1
with:
cache-name: CI - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
cache-name: Unit Tests CI - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
- name: Add Julia registries
run: |
using Pkg
Expand All @@ -54,6 +57,8 @@ jobs:
shell: julia --color=yes {0}
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
TENET_TEST_GROUP: ${{matrix.test_group}}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions test/integration/Reactant_test.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Reactant

@testset "Reactant" begin
# TODO test `make_tracer`
# TODO test `create_result`
Expand Down
69 changes: 37 additions & 32 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
using Test
using Tenet
using OMEinsum
using Reactant
using Adapt

include("Utils.jl")

@testset "Unit tests" verbose = true begin
include("Helpers_test.jl")
include("Tensor_test.jl")
include("Numerics_test.jl")
include("TensorNetwork_test.jl")
include("Transformations_test.jl")
include("Lane_test.jl")
include("Site_test.jl")
include("Moment_test.jl")
include("Quantum_test.jl")
include("Gate_test.jl")
include("Circuit_test.jl")
include("Lattice_test.jl")
include("Ansatz_test.jl")
include("Product_test.jl")
include("MPS_test.jl")
include("MPO_test.jl")
const TENET_TEST_GROUP = lowercase(get(ENV, "TENET_TEST_GROUP", "all"))

if TENET_TEST_GROUP == "all" || TENET_TEST_GROUP == "unit"
@testset "Unit tests" verbose = true begin
include("Helpers_test.jl")
include("Tensor_test.jl")
include("Numerics_test.jl")
include("TensorNetwork_test.jl")
include("Transformations_test.jl")
include("Lane_test.jl")
include("Site_test.jl")
include("Moment_test.jl")
include("Quantum_test.jl")
include("Gate_test.jl")
include("Circuit_test.jl")
include("Lattice_test.jl")
include("Ansatz_test.jl")
include("Product_test.jl")
include("MPS_test.jl")
include("MPO_test.jl")
end
end

@testset "Integration tests" verbose = true begin
include("integration/Reactant_test.jl")
include("integration/ChainRules_test.jl")
# include("integration/BlockArray_test.jl")
include("integration/Dagger_test.jl")
include("integration/Makie_test.jl")
include("integration/KrylovKit_test.jl")
include("integration/Quac_test.jl")
include("integration/ITensors_test.jl")
include("integration/ITensorNetworks_test.jl")
if TENET_TEST_GROUP == "all" || TENET_TEST_GROUP == "integration"
@testset "Integration tests" verbose = true begin
include("integration/Reactant_test.jl")
include("integration/ChainRules_test.jl")
# include("integration/BlockArray_test.jl")
include("integration/Dagger_test.jl")
include("integration/Makie_test.jl")
include("integration/KrylovKit_test.jl")
include("integration/Quac_test.jl")
include("integration/ITensors_test.jl")
include("integration/ITensorNetworks_test.jl")

@testset "Python" begin
include("integration/python/test_quimb.jl")
include("integration/python/test_qiskit.jl")
include("integration/python/test_qibo.jl")
@testset "Python" begin
include("integration/python/test_quimb.jl")
include("integration/python/test_qiskit.jl")
include("integration/python/test_qibo.jl")
end
end
end

Expand Down
Loading