Prepare and clean up with hooks#
Use hooks to prepare the environment or clean up after each main test.
pre_testselects the preparation scenario.post_testselects the cleanup scenario.
name = "nccl-test"
pre_test = "nccl_test_pre"
post_test = "nccl_test_post"
[[Tests]]
id = "Tests.1"
test_name = "nccl_test_all_reduce"
time_limit = "00:20:00"
CloudAI organizes hooks in a dedicated directory structure:
Hook directory: All hook configurations reside in
conf/hook/Hook test scenarios: Place pre-test hook and post-test hook scenario files in
conf/hook/Hook tests: Place individual tests referenced in hooks within
conf/hook/test/
Execution order:
Run the pre-test hook.
Run the main test if preparation succeeds.
Run the post-test hook if the prior steps succeed.
If preparation fails, CloudAI skips both the main test and its post-test hook.
name = "nccl_test_pre"
[[Tests]]
id = "Tests.1"
test_name = "nccl_test_all_reduce"
time_limit = "00:20:00"