diff mbox series

[RFC,5/8] docker: Restrict the 'travis' job to the Travis image

Message ID 20180628164643.9668-6-f4bug@amsat.org
State New
Headers show
Series Docker improvements | expand

Commit Message

Philippe Mathieu-Daudé June 28, 2018, 4:46 p.m. UTC
We can still run any test in Travis.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/docker/Makefile.include | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Alex Bennée June 29, 2018, 2:11 p.m. UTC | #1
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> We can still run any test in Travis.


I don't know about this one. The travis job isn't a fill in for real
travis, but a way to work through the matrix. I don't think it needs to
be restricted to any particular image.

>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/docker/Makefile.include | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 91d9665517..7d9d568eee 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -99,11 +99,17 @@ docker-image-tricore-cross: docker-image-debian9
>
>  # Expand all the pre-requistes for each docker image and test combination
>  $(foreach i,$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES), \
> -	$(foreach t,$(DOCKER_TESTS) $(DOCKER_TOOLS), \
> +	$(foreach t,$(DOCKER_TESTS), \
>  		$(eval .PHONY: docker-$t@$i) \
>  		$(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
> +		$(eval docker-test: docker-$t@$i) \
>  	) \
> -	$(foreach t,$(DOCKER_TESTS), \
> +)
> +# we only run Travis tests on the Travis image
> +$(foreach i,travis, \
> +	$(foreach t,$(DOCKER_TOOLS), \
> +		$(eval .PHONY: docker-$t@$i) \
> +		$(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
>  		$(eval docker-test: docker-$t@$i) \
>  	) \
>  )


--
Alex Bennée
Fam Zheng June 29, 2018, 2:22 p.m. UTC | #2
On Thu, 06/28 13:46, Philippe Mathieu-Daudé wrote:
> We can still run any test in Travis.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/docker/Makefile.include | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 91d9665517..7d9d568eee 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -99,11 +99,17 @@ docker-image-tricore-cross: docker-image-debian9
>  
>  # Expand all the pre-requistes for each docker image and test combination
>  $(foreach i,$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES), \
> -	$(foreach t,$(DOCKER_TESTS) $(DOCKER_TOOLS), \
> +	$(foreach t,$(DOCKER_TESTS), \
>  		$(eval .PHONY: docker-$t@$i) \
>  		$(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
> +		$(eval docker-test: docker-$t@$i) \
>  	) \
> -	$(foreach t,$(DOCKER_TESTS), \
> +)
> +# we only run Travis tests on the Travis image
> +$(foreach i,travis, \
> +	$(foreach t,$(DOCKER_TOOLS), \
> +		$(eval .PHONY: docker-$t@$i) \
> +		$(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
>  		$(eval docker-test: docker-$t@$i) \
>  	) \
>  )
> -- 
> 2.18.0
> 

Apart from Alex's concern (which I don't have), I suppose a 'requires travis'
and 'ENV features travis' pair is the correct way to do it. See test-mingw for
example.

Fam
Philippe Mathieu-Daudé June 29, 2018, 3:33 p.m. UTC | #3
On 06/29/2018 11:11 AM, Alex Bennée wrote:> Philippe Mathieu-Daudé
<f4bug@amsat.org> writes:
> 
>> We can still run any test in Travis.
> 
> 
> I don't know about this one. The travis job isn't a fill in for real
> travis, but a way to work through the matrix. I don't think it needs to
> be restricted to any particular image.

I had forgotten the context of this one.

IIRC, at some point the time expensive "make docker-test" try to run the
'travis' script in all docker images available, and failed with the
Debian ones. I now tested again with a single image and it did not fail.

As said Fam in the other reply to this tread, the script is protected by
the 'requires pyyaml' which isn't installed on the Debian images:

$ make docker-travis@debian-armhf-cross
  BUILD   debian9
  BUILD   debian-armhf-cross
  COPY    RUNNER
    RUN travis in qemu:debian-armhf-cross
Prerequisite 'pyyaml' not present, skip
$ echo $?
0

Anyway you are correct, this test isn't mean for a Travis builder but
for a developer to check what matrix will be run on Travis, so don't
need any image restriction.

(patch dropped).

Regards,

Phil.

>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  tests/docker/Makefile.include | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
>> index 91d9665517..7d9d568eee 100644
>> --- a/tests/docker/Makefile.include
>> +++ b/tests/docker/Makefile.include
>> @@ -99,11 +99,17 @@ docker-image-tricore-cross: docker-image-debian9
>>
>>  # Expand all the pre-requistes for each docker image and test combination
>>  $(foreach i,$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES), \
>> -	$(foreach t,$(DOCKER_TESTS) $(DOCKER_TOOLS), \
>> +	$(foreach t,$(DOCKER_TESTS), \
>>  		$(eval .PHONY: docker-$t@$i) \
>>  		$(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
>> +		$(eval docker-test: docker-$t@$i) \
>>  	) \
>> -	$(foreach t,$(DOCKER_TESTS), \
>> +)
>> +# we only run Travis tests on the Travis image
>> +$(foreach i,travis, \
>> +	$(foreach t,$(DOCKER_TOOLS), \
>> +		$(eval .PHONY: docker-$t@$i) \
>> +		$(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
>>  		$(eval docker-test: docker-$t@$i) \
>>  	) \
>>  )
> 
> 
> --
> Alex Bennée
>
diff mbox series

Patch

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 91d9665517..7d9d568eee 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -99,11 +99,17 @@  docker-image-tricore-cross: docker-image-debian9
 
 # Expand all the pre-requistes for each docker image and test combination
 $(foreach i,$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES), \
-	$(foreach t,$(DOCKER_TESTS) $(DOCKER_TOOLS), \
+	$(foreach t,$(DOCKER_TESTS), \
 		$(eval .PHONY: docker-$t@$i) \
 		$(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
+		$(eval docker-test: docker-$t@$i) \
 	) \
-	$(foreach t,$(DOCKER_TESTS), \
+)
+# we only run Travis tests on the Travis image
+$(foreach i,travis, \
+	$(foreach t,$(DOCKER_TOOLS), \
+		$(eval .PHONY: docker-$t@$i) \
+		$(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
 		$(eval docker-test: docker-$t@$i) \
 	) \
 )