diff mbox series

[03/16] Acceptance Tests: add mechanism for listing tests

Message ID 20210924185506.2542588-4-crosa@redhat.com
State New
Headers show
Series Acceptance Tests: use Avocado 91.0 features and other improvements | expand

Commit Message

Cleber Rosa Sept. 24, 2021, 6:54 p.m. UTC
It is helpful to know the tests that would be executed with a "make
check-acceptance" without executing them.  Let's introduce a "make
list-acceptance" rule for that purpose.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/Makefile.include | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Willian Rampazzo Oct. 6, 2021, 6:47 p.m. UTC | #1
On Fri, Sep 24, 2021 at 3:57 PM Cleber Rosa <crosa@redhat.com> wrote:
>
> It is helpful to know the tests that would be executed with a "make
> check-acceptance" without executing them.  Let's introduce a "make
> list-acceptance" rule for that purpose.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>  tests/Makefile.include | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index 2c03256ae8..d1f90572a7 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -17,6 +17,7 @@ ifneq ($(filter $(all-check-targets), check-softfloat),)
>         @echo " $(MAKE) check-softfloat      Run FPU emulation tests"
>  endif
>         @echo " $(MAKE) check-acceptance     Run acceptance (functional) tests for currently configured targets"
> +       @echo " $(MAKE) check-acceptance     List acceptance (functional) tests for currently configured targets"

s/check-acceptance/list-acceptance/

>         @echo
>         @echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
>         @echo " $(MAKE) check-venv           Creates a Python venv for tests"
> @@ -135,6 +136,13 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
>              $(if $(GITLAB_CI),,--failfast) tests/acceptance, \
>              "AVOCADO", "tests/acceptance")
>
> +list-acceptance: check-venv
> +       $(call quiet-command, \
> +            $(TESTS_VENV_DIR)/bin/python -m avocado list \
> +            --filter-by-tags-include-empty --filter-by-tags-include-empty-key \
> +            $(AVOCADO_TAGS) tests/acceptance, \

It would be interesting to adjust the command to use the
$(AVOCADO_CMDLINE_TAGS) and allow users to restrict the tests listed
by its tags.

> +            "AVOCADO", "list tests/acceptance")
> +
>  # Consolidated targets
>
>  .PHONY: check-block check check-clean get-vm-images
> --
> 2.31.1
>
diff mbox series

Patch

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 2c03256ae8..d1f90572a7 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -17,6 +17,7 @@  ifneq ($(filter $(all-check-targets), check-softfloat),)
 	@echo " $(MAKE) check-softfloat      Run FPU emulation tests"
 endif
 	@echo " $(MAKE) check-acceptance     Run acceptance (functional) tests for currently configured targets"
+	@echo " $(MAKE) check-acceptance     List acceptance (functional) tests for currently configured targets"
 	@echo
 	@echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
 	@echo " $(MAKE) check-venv           Creates a Python venv for tests"
@@ -135,6 +136,13 @@  check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
             $(if $(GITLAB_CI),,--failfast) tests/acceptance, \
             "AVOCADO", "tests/acceptance")
 
+list-acceptance: check-venv
+	$(call quiet-command, \
+            $(TESTS_VENV_DIR)/bin/python -m avocado list \
+            --filter-by-tags-include-empty --filter-by-tags-include-empty-key \
+            $(AVOCADO_TAGS) tests/acceptance, \
+            "AVOCADO", "list tests/acceptance")
+
 # Consolidated targets
 
 .PHONY: check-block check check-clean get-vm-images