diff mbox series

[3/3] support/testing: replace nose2 with pytest - CI

Message ID 20221021091531.2989489-3-oguz.ozhan@mind.be
State Changes Requested
Headers show
Series [1/3] support/testing: replace nose2 with pytest - Dockerfile | expand

Commit Message

Oguz Ozhan Oct. 21, 2022, 9:15 a.m. UTC
From: Oguz Ozhan <oguz.ozhan@mind.com>

- From web page of nose2:
(https://docs.nose2.io/en/latest/)
nose2 vs pytest:
  - pytest is an excellent test framework and we encourage users to consider it for new projects.
  - It has a bigger team of maintainers and a larger community of users.

- pytest is more robust and has more ability compared to nose2

- Changes in this patch:
  - the sed command was fine filtering the tests list with nose2 output but removing all operating on pytest output. With pytest no fine filtering is required to get the test names in correct format.

Signed-off-by: Oguz Ozhan <oguz.ozhan@mind.be>
---
 support/scripts/generate-gitlab-ci-yml | 2 --
 1 file changed, 2 deletions(-)

Comments

Ricardo Martincoski Oct. 30, 2022, 10:20 p.m. UTC | #1
Hello,

IMO, this change should be merged into patch 2.

On Fri, Oct 21, 2022 at 06:15 AM, Oguz Ozhan wrote:

> - From web page of nose2:
> (https://docs.nose2.io/en/latest/)
> nose2 vs pytest:
>   - pytest is an excellent test framework and we encourage users to consider it for new projects.
>   - It has a bigger team of maintainers and a larger community of users.
> 
> - pytest is more robust and has more ability compared to nose2
> 
> - Changes in this patch:
>   - the sed command was fine filtering the tests list with nose2 output but removing all operating on pytest output. With pytest no fine filtering is required to get the test names in correct format.
> 
> Signed-off-by: Oguz Ozhan <oguz.ozhan@mind.be>
> ---
>  support/scripts/generate-gitlab-ci-yml | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/support/scripts/generate-gitlab-ci-yml b/support/scripts/generate-gitlab-ci-yml
> index aa43aac019..bb4dcbbb22 100755
> --- a/support/scripts/generate-gitlab-ci-yml
> +++ b/support/scripts/generate-gitlab-ci-yml
> @@ -31,7 +31,6 @@ gen_tests() {
>      defconfigs=( $(cd configs; LC_ALL=C ls -1 *_defconfig) )
>  
>      runtimes=( $(./support/testing/run-tests -l 2>&1 \
> -                 | sed -r -e '/^test_run \((.*)\).*/!d; s//\1/' \
>                   | LC_ALL=C sort)
>               )
>  
> @@ -80,7 +79,6 @@ gen_tests() {
>              ;;
>            (*-tests.*)

This regexp must be adapted, something like this:
          (*-support*)
            pattern="${CI_COMMIT_REF_NAME/--/::}"
            runtimes=( $(./support/testing/run-tests -l 2>&1 \
                         | LC_ALL=C sort \
                         | grep "^${pattern##*-}")

Notice that ':' is not accepted on git branches, so we cannot use this branch
name to run a single test on GitLab CI:
 git push gitlab \
 HEAD:foo-support/testing/tests/package/test_php_lua.py::TestPhpLuaLuajit
so I guess we could use a pattern substitution, for instance:
 git push gitlab \
 HEAD:foo-support/testing/tests/package/test_php_lua.py--TestPhpLuaLuajit
and document it in the manual.

The manual must also be updated.
 docs/manual/contribute.txt: $ git push gitlab HEAD:foo-tests.init.test_busybox
 docs/manual/contribute.txt: $ git push gitlab HEAD:foo-tests.init

Regards,
Ricardo
diff mbox series

Patch

diff --git a/support/scripts/generate-gitlab-ci-yml b/support/scripts/generate-gitlab-ci-yml
index aa43aac019..bb4dcbbb22 100755
--- a/support/scripts/generate-gitlab-ci-yml
+++ b/support/scripts/generate-gitlab-ci-yml
@@ -31,7 +31,6 @@  gen_tests() {
     defconfigs=( $(cd configs; LC_ALL=C ls -1 *_defconfig) )
 
     runtimes=( $(./support/testing/run-tests -l 2>&1 \
-                 | sed -r -e '/^test_run \((.*)\).*/!d; s//\1/' \
                  | LC_ALL=C sort)
              )
 
@@ -80,7 +79,6 @@  gen_tests() {
             ;;
           (*-tests.*)
             runtimes=( $(./support/testing/run-tests -l 2>&1 \
-                         | sed -r -e '/^test_run \((.*)\).*/!d; s//\1/' \
                          | LC_ALL=C sort \
                          | grep "^${CI_COMMIT_REF_NAME##*-}")
                      )