[PATCH-for-5.1 6/8] tests/Makefile: Add fetch-acceptance-assets rule

Philippe Mathieu-Daudé posted 8 patches 5 years, 10 months ago
Maintainers: "Hervé Poussineau" <hpoussin@reactos.org>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Fam Zheng <fam@euphon.net>, Kamil Rytarowski <kamil@netbsd.org>, Fabien Chouteau <chouteau@adacore.com>, KONRAD Frederic <frederic.konrad@adacore.com>, "Alex Bennée" <alex.bennee@linaro.org>
[PATCH-for-5.1 6/8] tests/Makefile: Add fetch-acceptance-assets rule
Posted by Philippe Mathieu-Daudé 5 years, 10 months ago
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/Makefile.include | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 51de676298..90f457593c 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -906,6 +906,13 @@ get-vm-image-fedora-31-%: check-venv
 # download all vm images, according to defined targets
 get-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD))
 
+fetch-acceptance-assets: check-venv
+	$(call quiet-command, \
+            $(TESTS_VENV_DIR)/bin/python -m avocado \
+            --show=$(if $(DEBUG),avocado.test,$(AVOCADO_SHOW)) assets fetch \
+            tests/acceptance/*py, \
+            "AVOCADO", "tests/acceptance")
+
 check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
 	$(call quiet-command, \
             $(TESTS_VENV_DIR)/bin/python -m avocado \
-- 
2.21.1


Re: [PATCH-for-5.1 6/8] tests/Makefile: Add fetch-acceptance-assets rule
Posted by Alex Bennée 5 years, 10 months ago
Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/Makefile.include | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index 51de676298..90f457593c 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -906,6 +906,13 @@ get-vm-image-fedora-31-%: check-venv
>  # download all vm images, according to defined targets
>  get-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD))
>  
> +fetch-acceptance-assets: check-venv
> +	$(call quiet-command, \
> +            $(TESTS_VENV_DIR)/bin/python -m avocado \
> +            --show=$(if $(DEBUG),avocado.test,$(AVOCADO_SHOW)) assets fetch \
> +            tests/acceptance/*py, \
> +            "AVOCADO", "tests/acceptance")
> +

I'm wondering if we could expand this to a rule per-test group and
therefor allow parallel fetching of groups of assets?

>  check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
>  	$(call quiet-command, \
>              $(TESTS_VENV_DIR)/bin/python -m avocado \


-- 
Alex Bennée

Re: [PATCH-for-5.1 6/8] tests/Makefile: Add fetch-acceptance-assets rule
Posted by Willian Rampazzo 5 years, 10 months ago
On Mon, Apr 6, 2020 at 12:41 PM Alex Bennée <alex.bennee@linaro.org> wrote:
>
>
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---
> >  tests/Makefile.include | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/tests/Makefile.include b/tests/Makefile.include
> > index 51de676298..90f457593c 100644
> > --- a/tests/Makefile.include
> > +++ b/tests/Makefile.include
> > @@ -906,6 +906,13 @@ get-vm-image-fedora-31-%: check-venv
> >  # download all vm images, according to defined targets
> >  get-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD))
> >
> > +fetch-acceptance-assets: check-venv
> > +     $(call quiet-command, \
> > +            $(TESTS_VENV_DIR)/bin/python -m avocado \
> > +            --show=$(if $(DEBUG),avocado.test,$(AVOCADO_SHOW)) assets fetch \
> > +            tests/acceptance/*py, \
> > +            "AVOCADO", "tests/acceptance")
> > +
>
> I'm wondering if we could expand this to a rule per-test group and
> therefor allow parallel fetching of groups of assets?

This is a valid idea! Additionally, my suggestion is to organize the
tests by subdirectories under `tests/acceptance/`. Doing so makes it
easy to handle the target rule, adding the subdirectory to the assets
fetch command instead of listing specific tests for each group. Making
a list of tests for each group requires extra editing to the makefile
target when a new test is added. This can lead to new tests being
missed in their groups by mistake.

>
> >  check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
> >       $(call quiet-command, \
> >              $(TESTS_VENV_DIR)/bin/python -m avocado \
>
>
> --
> Alex Bennée
>


Re: [PATCH-for-5.1 6/8] tests/Makefile: Add fetch-acceptance-assets rule
Posted by Alex Bennée 5 years, 10 months ago
Willian Rampazzo <wrampazz@redhat.com> writes:

> On Mon, Apr 6, 2020 at 12:41 PM Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>>
>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>>
>> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> > ---
>> >  tests/Makefile.include | 7 +++++++
>> >  1 file changed, 7 insertions(+)
>> >
>> > diff --git a/tests/Makefile.include b/tests/Makefile.include
>> > index 51de676298..90f457593c 100644
>> > --- a/tests/Makefile.include
>> > +++ b/tests/Makefile.include
>> > @@ -906,6 +906,13 @@ get-vm-image-fedora-31-%: check-venv
>> >  # download all vm images, according to defined targets
>> >  get-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD))
>> >
>> > +fetch-acceptance-assets: check-venv
>> > +     $(call quiet-command, \
>> > +            $(TESTS_VENV_DIR)/bin/python -m avocado \
>> > +            --show=$(if $(DEBUG),avocado.test,$(AVOCADO_SHOW)) assets fetch \
>> > +            tests/acceptance/*py, \
>> > +            "AVOCADO", "tests/acceptance")
>> > +
>>
>> I'm wondering if we could expand this to a rule per-test group and
>> therefor allow parallel fetching of groups of assets?
>
> This is a valid idea! Additionally, my suggestion is to organize the
> tests by subdirectories under `tests/acceptance/`. Doing so makes it
> easy to handle the target rule, adding the subdirectory to the assets
> fetch command instead of listing specific tests for each group. Making
> a list of tests for each group requires extra editing to the makefile
> target when a new test is added. This can lead to new tests being
> missed in their groups by mistake.

I'd use wildcards to build up the groups so the Makefile doesn't need to
be messed with again.

>
>>
>> >  check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
>> >       $(call quiet-command, \
>> >              $(TESTS_VENV_DIR)/bin/python -m avocado \
>>
>>
>> --
>> Alex Bennée
>>


-- 
Alex Bennée