Skip to content

Commit

Permalink
Added labeling function for WarpX CI tests (ECP-WarpX#5253)
Browse files Browse the repository at this point in the history
* Added `label_warpx_test` function which labels a test
* CI tests, that run longer than 10 seconds, labeled with slow label
* Updated documentation.
* Clean-up
* Added labels to `test_3d_beam_beam_collision` and `test_rz_multiJ_psatd` CI tests
* Update Example to `-LE`

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
  • Loading branch information
oshapoval and ax3l authored Sep 13, 2024
1 parent dcc972c commit 4d4eecd
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Docs/source/developers/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ For easier debugging, it can be convenient to run the tests on your local machin
ctest --test-dir build -E laser_acceleration
* Run only tests not labeled with the ``slow`` label:

.. code-block:: sh
ctest --test-dir build -LE slow
Once the execution of CTest is completed, you can find all files associated with each test in its corresponding directory under ``build/bin/``.
For example, if you run the single test ``test_3d_laser_acceleration``, you can find all files associated with this test in the directory ``build/bin/test_3d_laser_acceleration/``.

Expand Down
16 changes: 16 additions & 0 deletions Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,22 @@ function(add_warpx_test
endif()
endfunction()

# Add a CTest label to a WarpX test set.
#
# Labeling it here will add the label to the run test, its analysis and its cleanup.
#
# name: unique name of this test
# label: ctest LABELS property value to be added
#
function(label_warpx_test name label)
set(_test_names "${name}.run;${name}.analysis;${name}.cleanup")
foreach(_test_name IN LISTS _test_names)
if(TEST ${_test_name})
set_property(TEST ${_test_name} APPEND PROPERTY LABELS "${label}")
endif()
endforeach()
endfunction()

# Add tests (alphabetical order) ##############################################
#

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ add_warpx_test(
diags/diag1/ # output
OFF # dependency
)
label_warpx_test(test_3d_beam_beam_collision slow)
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ add_warpx_test(
diags/diag1000001 # output
OFF # dependency
)
label_warpx_test(test_1d_laser_acceleration_fluid_boosted slow)

add_warpx_test(
test_1d_laser_acceleration_picmi # name
Expand Down Expand Up @@ -140,3 +141,4 @@ add_warpx_test(
diags/diag1000010 # output
OFF # dependency
)
label_warpx_test(test_rz_laser_acceleration_picmi slow)
1 change: 1 addition & 0 deletions Examples/Tests/langmuir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ if(WarpX_FFT)
diags/diag1000040 # output
OFF # dependency
)
label_warpx_test(test_3d_langmuir_multi_psatd_vay_deposition_nodal slow)
endif()

add_warpx_test(
Expand Down
1 change: 1 addition & 0 deletions Examples/Tests/nci_psatd_stability/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,5 @@ if(WarpX_FFT)
diags/diag1000050 # output
OFF # dependency
)
label_warpx_test(test_rz_multiJ_psatd slow)
endif()
1 change: 1 addition & 0 deletions Examples/Tests/nodal_electrostatic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ add_warpx_test(
diags/diag1000010 # output
OFF # dependency
)
label_warpx_test(test_3d_nodal_electrostatic_solver slow)
1 change: 1 addition & 0 deletions Examples/Tests/ohm_solver_em_modes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ add_warpx_test(
diags/diag1000100 # output
OFF # dependency
)
label_warpx_test(test_rz_ohm_solver_em_modes_picmi slow)
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ add_warpx_test(
diags/diag1000100 # output
OFF # dependency
)
label_warpx_test(test_2d_ohm_solver_landau_damping_picmi slow)
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ add_warpx_test(
diags/diag1002500 # output
OFF # dependency
)
label_warpx_test(test_1d_ohm_solver_ion_beam_picmi slow)
1 change: 1 addition & 0 deletions Examples/Tests/particles_in_pml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ add_warpx_test(
diags/diag1000200 # output
OFF # dependency
)
label_warpx_test(test_3d_particles_in_pml_mr slow)

0 comments on commit 4d4eecd

Please sign in to comment.