diff mbox series

[v6,4/4] docs: add test for firmware.json QAPI

Message ID 20240719-qapi-firmware-json-v6-4-c2e3de390b58@linutronix.de (mailing list archive)
State New, archived
Headers show
Series docs/interop/firmware.json: scripts/qapi-gen.py compatibility | expand

Commit Message

Thomas Weißschuh July 19, 2024, 7:37 a.m. UTC
To make sure that the QAPI description stays valid, add a testcase.

Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/d9ce0234-4beb-4b90-b14c-76810d3b81d7@linaro.org/
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 docs/meson.build | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Markus Armbruster July 19, 2024, 12:38 p.m. UTC | #1
Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:

> To make sure that the QAPI description stays valid, add a testcase.
>
> Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Link: https://lore.kernel.org/qemu-devel/d9ce0234-4beb-4b90-b14c-76810d3b81d7@linaro.org/
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
>  docs/meson.build | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/docs/meson.build b/docs/meson.build
> index 9040f860ae1a..bcca45a342a3 100644
> --- a/docs/meson.build
> +++ b/docs/meson.build
> @@ -99,3 +99,8 @@ if build_docs
>    alias_target('html', sphinxdocs)
>    alias_target('man', sphinxmans)
>  endif
> +
> +test('QAPI firmware.json regression tests', python,
> +     args: [qapi_gen.full_path(), '-o', meson.current_build_dir() / 'qapi',
> +            meson.current_source_dir() / 'interop/firmware.json'],
> +     env: test_env, suite: ['qapi-schema', 'qapi-interop'])

Acked-by: Markus Armbruster <armbru@redhat.com>
Philippe Mathieu-Daudé July 22, 2024, 10:15 p.m. UTC | #2
Hi Thomas,

On 19/7/24 09:37, Thomas Weißschuh wrote:
> To make sure that the QAPI description stays valid, add a testcase.
> 
> Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Link: https://lore.kernel.org/qemu-devel/d9ce0234-4beb-4b90-b14c-76810d3b81d7@linaro.org/
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
>   docs/meson.build | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/docs/meson.build b/docs/meson.build
> index 9040f860ae1a..bcca45a342a3 100644
> --- a/docs/meson.build
> +++ b/docs/meson.build
> @@ -99,3 +99,8 @@ if build_docs
>     alias_target('html', sphinxdocs)
>     alias_target('man', sphinxmans)
>   endif
> +
> +test('QAPI firmware.json regression tests', python,
> +     args: [qapi_gen.full_path(), '-o', meson.current_build_dir() / 'qapi',
> +            meson.current_source_dir() / 'interop/firmware.json'],
> +     env: test_env, suite: ['qapi-schema', 'qapi-interop'])

Did you test this on GitLab CI? Many jobs are failing as:

Program /builds/qemu/build/pyvenv/bin/sphinx-build skipped: feature docs 
disabled
../docs/meson.build:106:10: ERROR: Unknown variable "test_env".

See https://gitlab.com/philmd/qemu/-/pipelines/1383618475/failures
Thomas Weißschuh July 23, 2024, 6:32 a.m. UTC | #3
Hi Philippe,

On Tue, Jul 23, 2024 at 12:15:24AM GMT, Philippe Mathieu-Daudé wrote:
> Hi Thomas,
> 
> On 19/7/24 09:37, Thomas Weißschuh wrote:
> > To make sure that the QAPI description stays valid, add a testcase.
> > 
> > Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > Link: https://lore.kernel.org/qemu-devel/d9ce0234-4beb-4b90-b14c-76810d3b81d7@linaro.org/
> > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> > ---
> >   docs/meson.build | 5 +++++
> >   1 file changed, 5 insertions(+)
> > 
> > diff --git a/docs/meson.build b/docs/meson.build
> > index 9040f860ae1a..bcca45a342a3 100644
> > --- a/docs/meson.build
> > +++ b/docs/meson.build
> > @@ -99,3 +99,8 @@ if build_docs
> >     alias_target('html', sphinxdocs)
> >     alias_target('man', sphinxmans)
> >   endif
> > +
> > +test('QAPI firmware.json regression tests', python,
> > +     args: [qapi_gen.full_path(), '-o', meson.current_build_dir() / 'qapi',
> > +            meson.current_source_dir() / 'interop/firmware.json'],
> > +     env: test_env, suite: ['qapi-schema', 'qapi-interop'])
> 
> Did you test this on GitLab CI? Many jobs are failing as:
> 
> Program /builds/qemu/build/pyvenv/bin/sphinx-build skipped: feature docs
> disabled
> ../docs/meson.build:106:10: ERROR: Unknown variable "test_env".
> 
> See https://gitlab.com/philmd/qemu/-/pipelines/1383618475/failures

No, I only tested it locally. It works there.
I'll try to setup a personal GitLab CI.

To fix the issue, I think "test_env" can be removed.
The other calls to "qapi_gen", which 

As a fix for this issue, I think "test_env" can be removed,
and apparently "qapi_gen" can also be executed without the explicit
python reference:


diff --git a/docs/meson.build b/docs/meson.build
index bcca45a342a3..322452c87787 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -100,7 +100,7 @@ if build_docs
   alias_target('man', sphinxmans)
 endif

-test('QAPI firmware.json regression tests', python,
-     args: [qapi_gen.full_path(), '-o', meson.current_build_dir() / 'qapi',
+test('QAPI firmware.json regression tests', qapi_gen,
+     args: ['-o', meson.current_build_dir() / 'qapi',
             meson.current_source_dir() / 'interop/firmware.json'],
-     env: test_env, suite: ['qapi-schema', 'qapi-interop'])
+     suite: ['qapi-schema', 'qapi-interop'])
diff mbox series

Patch

diff --git a/docs/meson.build b/docs/meson.build
index 9040f860ae1a..bcca45a342a3 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -99,3 +99,8 @@  if build_docs
   alias_target('html', sphinxdocs)
   alias_target('man', sphinxmans)
 endif
+
+test('QAPI firmware.json regression tests', python,
+     args: [qapi_gen.full_path(), '-o', meson.current_build_dir() / 'qapi',
+            meson.current_source_dir() / 'interop/firmware.json'],
+     env: test_env, suite: ['qapi-schema', 'qapi-interop'])