[libcamera-ci] Enable junit artifact generation for test-unit job
diff mbox series

Message ID 20241215212255.20001-1-laurent.pinchart@ideasonboard.com
State New
Headers show
Series
  • [libcamera-ci] Enable junit artifact generation for test-unit job
Related show

Commit Message

Laurent Pinchart Dec. 15, 2024, 9:22 p.m. UTC
Bump the minimum meson version to 1.2.0 to generate a proper junit
report, and package it in artifacts in the test-unit job.

Add the --break-system-packages to `pip3 install` for Debian bookworm
and newer, as pip3 otherwise fails.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Junit report output for unit tests:
https://gitlab.freedesktop.org/pinchartl/libcamera/-/pipelines/1330345/test_report?job_name=test-unit
---
 .gitlab-ci/setup-container.sh | 11 ++++++++---
 gitlab-ci.yml                 | 16 ++++++----------
 2 files changed, 14 insertions(+), 13 deletions(-)

Comments

Jacopo Mondi Dec. 16, 2024, 7:40 a.m. UTC | #1
On Sun, Dec 15, 2024 at 11:22:55PM +0200, Laurent Pinchart wrote:
> Bump the minimum meson version to 1.2.0 to generate a proper junit
> report, and package it in artifacts in the test-unit job.
>
> Add the --break-system-packages to `pip3 install` for Debian bookworm
> and newer, as pip3 otherwise fails.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> Junit report output for unit tests:
> https://gitlab.freedesktop.org/pinchartl/libcamera/-/pipelines/1330345/test_report?job_name=test-unit
> ---
>  .gitlab-ci/setup-container.sh | 11 ++++++++---
>  gitlab-ci.yml                 | 16 ++++++----------
>  2 files changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/.gitlab-ci/setup-container.sh b/.gitlab-ci/setup-container.sh
> index d2909c7257d35b0d..6146bee4d55ea348 100755
> --- a/.gitlab-ci/setup-container.sh
> +++ b/.gitlab-ci/setup-container.sh
> @@ -187,17 +187,22 @@ cbuild_fixups() {
>  	echo "Applying miscellaneous fixups"
>
>  	local min_version
> +	local pip3_options
>  	local version
>
> +	if [[ $FDO_DISTRIBUTION_VERSION != 'bullseye' ]] ; then
> +		pip3_options=--break-system-packages
> +	fi
> +
>  	# Install meson from pip.
> -	min_version=1.0.1
> +	min_version=1.2.0
>  	version=$(dpkg_version meson)
>  	if dpkg_check_version $version $min_version ; then
>  		echo "meson $version too old, installing $min_version from pip"
>
>  		apt remove -y meson
>  		apt install -y python3-pip
> -		pip3 install meson==${min_version}
> +		pip3 install ${pip3_options} meson==${min_version}
>  	fi
>
>  	# Install pygments from pip.
> @@ -207,7 +212,7 @@ cbuild_fixups() {
>  		echo "pygments $version too old, installing $min_version from pip"
>
>  		apt install -y python3-pip
> -		pip3 install pygments==${min_version}
> +		pip3 install ${pip3_options} pygments==${min_version}
>  	fi
>
>  	# Create pybind11.pc manually if not provided by the distribution
> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> index 06ab27dc0af0d9df..2b37b7ed59d4fbd0 100644
> --- a/gitlab-ci.yml
> +++ b/gitlab-ci.yml
> @@ -59,17 +59,17 @@ include:
>  .libcamera-ci.debian:11:
>    variables:
>      FDO_DISTRIBUTION_VERSION: 'bullseye'
> -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
>
>  .libcamera-ci.debian:12:
>    variables:
>      FDO_DISTRIBUTION_VERSION: 'bookworm'
> -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
>
>  .libcamera-ci.debian:13:
>    variables:
>      FDO_DISTRIBUTION_VERSION: 'trixie'
> -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
>
>  .container-debian:
>    extends:
> @@ -406,10 +406,6 @@ test-unit:
>        -D qcam=disabled
>        -D test=true
>        -D v4l2=true
> -
> -  # meson prior to 1.2.0 doesn't correctly escape non-printable characters
> -  # when generating the testlog XML. This results in an unparseable file.
> -  # Skip it for now.
> -  # artifacts:
> -  #   reports:
> -  #     junit: build/meson-logs/testlog.junit.xml
> +  artifacts:
> +    reports:
> +      junit: build/meson-logs/testlog.junit.xml

So these are generated by default by meson ?

The output is indeed nice from the web interface
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

> --
> Regards,
>
> Laurent Pinchart
>
Laurent Pinchart Dec. 16, 2024, 10:03 a.m. UTC | #2
On Mon, Dec 16, 2024 at 08:40:14AM +0100, Jacopo Mondi wrote:
> On Sun, Dec 15, 2024 at 11:22:55PM +0200, Laurent Pinchart wrote:
> > Bump the minimum meson version to 1.2.0 to generate a proper junit
> > report, and package it in artifacts in the test-unit job.
> >
> > Add the --break-system-packages to `pip3 install` for Debian bookworm
> > and newer, as pip3 otherwise fails.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > Junit report output for unit tests:
> > https://gitlab.freedesktop.org/pinchartl/libcamera/-/pipelines/1330345/test_report?job_name=test-unit
> > ---
> >  .gitlab-ci/setup-container.sh | 11 ++++++++---
> >  gitlab-ci.yml                 | 16 ++++++----------
> >  2 files changed, 14 insertions(+), 13 deletions(-)
> >
> > diff --git a/.gitlab-ci/setup-container.sh b/.gitlab-ci/setup-container.sh
> > index d2909c7257d35b0d..6146bee4d55ea348 100755
> > --- a/.gitlab-ci/setup-container.sh
> > +++ b/.gitlab-ci/setup-container.sh
> > @@ -187,17 +187,22 @@ cbuild_fixups() {
> >  	echo "Applying miscellaneous fixups"
> >
> >  	local min_version
> > +	local pip3_options
> >  	local version
> >
> > +	if [[ $FDO_DISTRIBUTION_VERSION != 'bullseye' ]] ; then
> > +		pip3_options=--break-system-packages
> > +	fi
> > +
> >  	# Install meson from pip.
> > -	min_version=1.0.1
> > +	min_version=1.2.0
> >  	version=$(dpkg_version meson)
> >  	if dpkg_check_version $version $min_version ; then
> >  		echo "meson $version too old, installing $min_version from pip"
> >
> >  		apt remove -y meson
> >  		apt install -y python3-pip
> > -		pip3 install meson==${min_version}
> > +		pip3 install ${pip3_options} meson==${min_version}
> >  	fi
> >
> >  	# Install pygments from pip.
> > @@ -207,7 +212,7 @@ cbuild_fixups() {
> >  		echo "pygments $version too old, installing $min_version from pip"
> >
> >  		apt install -y python3-pip
> > -		pip3 install pygments==${min_version}
> > +		pip3 install ${pip3_options} pygments==${min_version}
> >  	fi
> >
> >  	# Create pybind11.pc manually if not provided by the distribution
> > diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> > index 06ab27dc0af0d9df..2b37b7ed59d4fbd0 100644
> > --- a/gitlab-ci.yml
> > +++ b/gitlab-ci.yml
> > @@ -59,17 +59,17 @@ include:
> >  .libcamera-ci.debian:11:
> >    variables:
> >      FDO_DISTRIBUTION_VERSION: 'bullseye'
> > -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> > +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
> >
> >  .libcamera-ci.debian:12:
> >    variables:
> >      FDO_DISTRIBUTION_VERSION: 'bookworm'
> > -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> > +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
> >
> >  .libcamera-ci.debian:13:
> >    variables:
> >      FDO_DISTRIBUTION_VERSION: 'trixie'
> > -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> > +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
> >
> >  .container-debian:
> >    extends:
> > @@ -406,10 +406,6 @@ test-unit:
> >        -D qcam=disabled
> >        -D test=true
> >        -D v4l2=true
> > -
> > -  # meson prior to 1.2.0 doesn't correctly escape non-printable characters
> > -  # when generating the testlog XML. This results in an unparseable file.
> > -  # Skip it for now.
> > -  # artifacts:
> > -  #   reports:
> > -  #     junit: build/meson-logs/testlog.junit.xml
> > +  artifacts:
> > +    reports:
> > +      junit: build/meson-logs/testlog.junit.xml
> 
> So these are generated by default by meson ?

Yes, it's nice :-)

> The output is indeed nice from the web interface
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Kieran Bingham Dec. 16, 2024, 12:21 p.m. UTC | #3
Quoting Laurent Pinchart (2024-12-16 10:03:45)
> On Mon, Dec 16, 2024 at 08:40:14AM +0100, Jacopo Mondi wrote:
> > On Sun, Dec 15, 2024 at 11:22:55PM +0200, Laurent Pinchart wrote:
> > > Bump the minimum meson version to 1.2.0 to generate a proper junit
> > > report, and package it in artifacts in the test-unit job.
> > >
> > > Add the --break-system-packages to `pip3 install` for Debian bookworm
> > > and newer, as pip3 otherwise fails.
> > >
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > ---
> > > Junit report output for unit tests:
> > > https://gitlab.freedesktop.org/pinchartl/libcamera/-/pipelines/1330345/test_report?job_name=test-unit
> > > ---

That indeed looks nice for integrating into the pipeline.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

I look forward to seeing more tests either virtual or real hardware
included :D



> > >  .gitlab-ci/setup-container.sh | 11 ++++++++---
> > >  gitlab-ci.yml                 | 16 ++++++----------
> > >  2 files changed, 14 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/.gitlab-ci/setup-container.sh b/.gitlab-ci/setup-container.sh
> > > index d2909c7257d35b0d..6146bee4d55ea348 100755
> > > --- a/.gitlab-ci/setup-container.sh
> > > +++ b/.gitlab-ci/setup-container.sh
> > > @@ -187,17 +187,22 @@ cbuild_fixups() {
> > >     echo "Applying miscellaneous fixups"
> > >
> > >     local min_version
> > > +   local pip3_options
> > >     local version
> > >
> > > +   if [[ $FDO_DISTRIBUTION_VERSION != 'bullseye' ]] ; then
> > > +           pip3_options=--break-system-packages
> > > +   fi
> > > +
> > >     # Install meson from pip.
> > > -   min_version=1.0.1
> > > +   min_version=1.2.0
> > >     version=$(dpkg_version meson)
> > >     if dpkg_check_version $version $min_version ; then
> > >             echo "meson $version too old, installing $min_version from pip"
> > >
> > >             apt remove -y meson
> > >             apt install -y python3-pip
> > > -           pip3 install meson==${min_version}
> > > +           pip3 install ${pip3_options} meson==${min_version}
> > >     fi
> > >
> > >     # Install pygments from pip.
> > > @@ -207,7 +212,7 @@ cbuild_fixups() {
> > >             echo "pygments $version too old, installing $min_version from pip"
> > >
> > >             apt install -y python3-pip
> > > -           pip3 install pygments==${min_version}
> > > +           pip3 install ${pip3_options} pygments==${min_version}
> > >     fi
> > >
> > >     # Create pybind11.pc manually if not provided by the distribution
> > > diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> > > index 06ab27dc0af0d9df..2b37b7ed59d4fbd0 100644
> > > --- a/gitlab-ci.yml
> > > +++ b/gitlab-ci.yml
> > > @@ -59,17 +59,17 @@ include:
> > >  .libcamera-ci.debian:11:
> > >    variables:
> > >      FDO_DISTRIBUTION_VERSION: 'bullseye'
> > > -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> > > +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
> > >
> > >  .libcamera-ci.debian:12:
> > >    variables:
> > >      FDO_DISTRIBUTION_VERSION: 'bookworm'
> > > -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> > > +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
> > >
> > >  .libcamera-ci.debian:13:
> > >    variables:
> > >      FDO_DISTRIBUTION_VERSION: 'trixie'
> > > -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> > > +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
> > >
> > >  .container-debian:
> > >    extends:
> > > @@ -406,10 +406,6 @@ test-unit:
> > >        -D qcam=disabled
> > >        -D test=true
> > >        -D v4l2=true
> > > -
> > > -  # meson prior to 1.2.0 doesn't correctly escape non-printable characters
> > > -  # when generating the testlog XML. This results in an unparseable file.
> > > -  # Skip it for now.
> > > -  # artifacts:
> > > -  #   reports:
> > > -  #     junit: build/meson-logs/testlog.junit.xml
> > > +  artifacts:
> > > +    reports:
> > > +      junit: build/meson-logs/testlog.junit.xml
> > 
> > So these are generated by default by meson ?
> 
> Yes, it's nice :-)
> 
> > The output is indeed nice from the web interface
> > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> 
> -- 
> Regards,
> 
> Laurent Pinchart
Barnabás Pőcze Dec. 18, 2024, 11:05 a.m. UTC | #4
Hi


2024. december 15., vasárnap 22:22 keltezéssel, Laurent Pinchart <laurent.pinchart@ideasonboard.com> írta:

> Bump the minimum meson version to 1.2.0 to generate a proper junit
> report, and package it in artifacts in the test-unit job.
> 
> Add the --break-system-packages to `pip3 install` for Debian bookworm
> and newer, as pip3 otherwise fails.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> Junit report output for unit tests:
> https://gitlab.freedesktop.org/pinchartl/libcamera/-/pipelines/1330345/test_report?job_name=test-unit
> ---
>  .gitlab-ci/setup-container.sh | 11 ++++++++---
>  gitlab-ci.yml                 | 16 ++++++----------
>  2 files changed, 14 insertions(+), 13 deletions(-)
> 
> diff --git a/.gitlab-ci/setup-container.sh b/.gitlab-ci/setup-container.sh
> index d2909c7257d35b0d..6146bee4d55ea348 100755
> --- a/.gitlab-ci/setup-container.sh
> +++ b/.gitlab-ci/setup-container.sh
> @@ -187,17 +187,22 @@ cbuild_fixups() {
>  	echo "Applying miscellaneous fixups"
> 
>  	local min_version
> +	local pip3_options
>  	local version
> 
> +	if [[ $FDO_DISTRIBUTION_VERSION != 'bullseye' ]] ; then
> +		pip3_options=--break-system-packages
> +	fi
> +
>  	# Install meson from pip.
> -	min_version=1.0.1
> +	min_version=1.2.0
>  	version=$(dpkg_version meson)
>  	if dpkg_check_version $version $min_version ; then
>  		echo "meson $version too old, installing $min_version from pip"
> 
>  		apt remove -y meson
>  		apt install -y python3-pip
> -		pip3 install meson==${min_version}
> +		pip3 install ${pip3_options} meson==${min_version}
>  	fi
> 
>  	# Install pygments from pip.
> @@ -207,7 +212,7 @@ cbuild_fixups() {
>  		echo "pygments $version too old, installing $min_version from pip"
> 
>  		apt install -y python3-pip
> -		pip3 install pygments==${min_version}
> +		pip3 install ${pip3_options} pygments==${min_version}
>  	fi
> 
>  	# Create pybind11.pc manually if not provided by the distribution
> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> index 06ab27dc0af0d9df..2b37b7ed59d4fbd0 100644
> --- a/gitlab-ci.yml
> +++ b/gitlab-ci.yml
> @@ -59,17 +59,17 @@ include:
>  .libcamera-ci.debian:11:
>    variables:
>      FDO_DISTRIBUTION_VERSION: 'bullseye'
> -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
> 
>  .libcamera-ci.debian:12:
>    variables:
>      FDO_DISTRIBUTION_VERSION: 'bookworm'
> -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
> 
>  .libcamera-ci.debian:13:
>    variables:
>      FDO_DISTRIBUTION_VERSION: 'trixie'
> -    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
> +    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
> 
>  .container-debian:
>    extends:
> @@ -406,10 +406,6 @@ test-unit:
>        -D qcam=disabled
>        -D test=true
>        -D v4l2=true
> -
> -  # meson prior to 1.2.0 doesn't correctly escape non-printable characters
> -  # when generating the testlog XML. This results in an unparseable file.
> -  # Skip it for now.
> -  # artifacts:
> -  #   reports:
> -  #     junit: build/meson-logs/testlog.junit.xml
> +  artifacts:
> +    reports:
> +      junit: build/meson-logs/testlog.junit.xml

Unfortunately it seem that gitlab accepts this, even though this change causes
the dictionary to have duplicate `artifacts` keys. Even though gitlab accepts it,
seemingly only the last value is kept, so the meson logs are not uploaded anymore.


Regards,
Barnabás Pőcze

Patch
diff mbox series

diff --git a/.gitlab-ci/setup-container.sh b/.gitlab-ci/setup-container.sh
index d2909c7257d35b0d..6146bee4d55ea348 100755
--- a/.gitlab-ci/setup-container.sh
+++ b/.gitlab-ci/setup-container.sh
@@ -187,17 +187,22 @@  cbuild_fixups() {
 	echo "Applying miscellaneous fixups"
 
 	local min_version
+	local pip3_options
 	local version
 
+	if [[ $FDO_DISTRIBUTION_VERSION != 'bullseye' ]] ; then
+		pip3_options=--break-system-packages
+	fi
+
 	# Install meson from pip.
-	min_version=1.0.1
+	min_version=1.2.0
 	version=$(dpkg_version meson)
 	if dpkg_check_version $version $min_version ; then
 		echo "meson $version too old, installing $min_version from pip"
 
 		apt remove -y meson
 		apt install -y python3-pip
-		pip3 install meson==${min_version}
+		pip3 install ${pip3_options} meson==${min_version}
 	fi
 
 	# Install pygments from pip.
@@ -207,7 +212,7 @@  cbuild_fixups() {
 		echo "pygments $version too old, installing $min_version from pip"
 
 		apt install -y python3-pip
-		pip3 install pygments==${min_version}
+		pip3 install ${pip3_options} pygments==${min_version}
 	fi
 
 	# Create pybind11.pc manually if not provided by the distribution
diff --git a/gitlab-ci.yml b/gitlab-ci.yml
index 06ab27dc0af0d9df..2b37b7ed59d4fbd0 100644
--- a/gitlab-ci.yml
+++ b/gitlab-ci.yml
@@ -59,17 +59,17 @@  include:
 .libcamera-ci.debian:11:
   variables:
     FDO_DISTRIBUTION_VERSION: 'bullseye'
-    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
+    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
 
 .libcamera-ci.debian:12:
   variables:
     FDO_DISTRIBUTION_VERSION: 'bookworm'
-    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
+    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
 
 .libcamera-ci.debian:13:
   variables:
     FDO_DISTRIBUTION_VERSION: 'trixie'
-    FDO_DISTRIBUTION_TAG: '2024-11-05.1'
+    FDO_DISTRIBUTION_TAG: '2024-12-15.1'
 
 .container-debian:
   extends:
@@ -406,10 +406,6 @@  test-unit:
       -D qcam=disabled
       -D test=true
       -D v4l2=true
-
-  # meson prior to 1.2.0 doesn't correctly escape non-printable characters
-  # when generating the testlog XML. This results in an unparseable file.
-  # Skip it for now.
-  # artifacts:
-  #   reports:
-  #     junit: build/meson-logs/testlog.junit.xml
+  artifacts:
+    reports:
+      junit: build/meson-logs/testlog.junit.xml