Skip to content

Commit

Permalink
Parallelize CI by splitting Unit Tests and Integration Tests on dif…
Browse files Browse the repository at this point in the history
…ferent Github actions (#288)

* Update runtests in order to split Integration and Unit tests actions

* Update CI.yml in order to split Unit and Integration Tests actions

* Fix indent in code

* Fix indent in code

* Update runtests by passing the target testset in an ENV

* Enhance CI.yml for changes in runtests.jl

* Fix typo in runtests.jl

* Move Reactant import from runtests.jl to Reactant_tests.jl

* Fix typo on CI.yml

* Add temporal debug print on runtests.jl

* Fix env setting from CI.yml

* Apply @mofeing suggestions from code review

Co-authored-by: Sergio Sánchez Ramírez <15837247+mofeing@users.noreply.github.com>

---------

Co-authored-by: Sergio Sánchez Ramírez <15837247+mofeing@users.noreply.github.com>
  • Loading branch information
jofrevalles and mofeing authored Jan 15, 2025
1 parent 26dfa93 commit dda11af
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 34 deletions.
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

0 comments on commit dda11af

Please sign in to comment.