From 4de64e4784795ee6ec932d12b0925b777c42cff4 Mon Sep 17 00:00:00 2001 From: Vivien Date: Tue, 19 Mar 2024 16:18:05 +0100 Subject: [PATCH 1/2] test: add comments about "slow" tag --- src/lib_test/tag.mli | 4 +++- tezt/lib_alcotezt/alcotest.mli | 7 ++++++- tezt/lib_alcotezt/alcotest_lwt.mli | 5 +---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib_test/tag.mli b/src/lib_test/tag.mli index 819f68aa4d10..61928fe5dd5d 100644 --- a/src/lib_test/tag.mli +++ b/src/lib_test/tag.mli @@ -80,5 +80,7 @@ val tezos2 : string val etherlink : string (** ["slow"]: tag for tests that are too slow for the CI's [before_merging] - pipelines and that will only be run on the scheduled pipeline. *) + pipelines and that will only be run on the scheduled pipeline. + + This tag should be used for tests that take more than 2 minutes in the CI. *) val slow : string diff --git a/tezt/lib_alcotezt/alcotest.mli b/tezt/lib_alcotezt/alcotest.mli index 4faa3780ce2e..b73b83e2fc31 100644 --- a/tezt/lib_alcotezt/alcotest.mli +++ b/tezt/lib_alcotezt/alcotest.mli @@ -45,7 +45,12 @@ type return = unit (** Speed levels. In Alcotest, one can ask not to run slow tests with [-q] from the command-line. - In Tezt, the equivalent is [-a quick]. *) + In Tezt, the equivalent is [quick]. + + Tests registered with [`Slow] or [`Quick] will have respectively the tag + ["slow"] or ["quick"]. + ["slow"] tag may have consequences on how the test will be handled by the + CI. More information is given in [src/lib_test/tag.mli]. *) type speed_level = [`Quick | `Slow] (** Test cases. diff --git a/tezt/lib_alcotezt/alcotest_lwt.mli b/tezt/lib_alcotezt/alcotest_lwt.mli index db4c16875ce9..ffb38a933fb0 100644 --- a/tezt/lib_alcotezt/alcotest_lwt.mli +++ b/tezt/lib_alcotezt/alcotest_lwt.mli @@ -36,10 +36,7 @@ (** Return type for tests. *) type return = unit Lwt.t -(** Speed levels. - - In Alcotest, one can ask not to run slow tests with [-q] from the command-line. - In Tezt, the equivalent is [-a quick]. *) +(** Speed levels. Same as {!Alcotest.speed_level}. *) type speed_level = [`Quick | `Slow] (** Test cases. -- GitLab From c777f2711cac7907b48b309577074358bc2ee37b Mon Sep 17 00:00:00 2001 From: Vivien Date: Wed, 27 Mar 2024 16:54:35 +0100 Subject: [PATCH 2/2] doc: add doc about slow tag, tags and CI --- docs/developer/testing.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/developer/testing.rst b/docs/developer/testing.rst index f73b60c13f2e..50e12d8b8c66 100644 --- a/docs/developer/testing.rst +++ b/docs/developer/testing.rst @@ -490,9 +490,13 @@ runner parallelism while limiting the number of jobs per pipeline. The grain used varies slightly for different types of tests: +.. _gitlab_tezt_ci: + Tezt integration and regression tests - Tezt tests are grouped in 3 batch jobs. New tests increases the - size of the last batch. + By default, Tezt tests are grouped in several batch jobs named ``tezt`` and + are executed in merge request pipelines. According to the tags attached to them, + the tests can be handled differently. The description of these tags can be + found in :src:`src/lib_test/tag.mli`. The OCaml package tests (Alcotest & QCheck) The OCaml package tests are regrouped in a set of jobs per protocol package, @@ -618,3 +622,8 @@ follow this convention: directory structure. 4. OCaml comments must be valid ``ocamldoc`` `special comments `_. + +5. If a test takes 2 minutes or more on the CI, it should be tagged as ``slow`` + (see :ref:`Tezt integration and regression tests`). Note + that tests with tag ``slow`` do not run automatically in the CI of merge + requests. -- GitLab