From 54a8d429e1686971c6c9647c1229c7ca755a3656 Mon Sep 17 00:00:00 2001 From: Alex Stewart Date: Fri, 20 Sep 2024 11:12:36 -0400 Subject: [PATCH 1/3] nilrt-snac: make test output ptest-compliant The NI ptest-parser (and ptests in general) use the AutoMake style of test output. The nilrt-snac integration tests uses pytest formatting, which is generally non-compliant and obscures individual testcase output from being parsed by the RTOS ptesting pipeline. Use the python3-unittest-automake-output plugin for pytest, to output the test results in format ptest can parse. Signed-off-by: Alex Stewart --- recipes-ni/nilrt-snac/files/run-ptest | 2 +- recipes-ni/nilrt-snac/nilrt-snac_git.bb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes-ni/nilrt-snac/files/run-ptest b/recipes-ni/nilrt-snac/files/run-ptest index 053978fe..22b78ed5 100644 --- a/recipes-ni/nilrt-snac/files/run-ptest +++ b/recipes-ni/nilrt-snac/files/run-ptest @@ -3,6 +3,6 @@ import pytest pytest.main([ - "-v", + "--automake", "/usr/lib/nilrt-snac/tests/integration", ]) diff --git a/recipes-ni/nilrt-snac/nilrt-snac_git.bb b/recipes-ni/nilrt-snac/nilrt-snac_git.bb index 9e559e79..07ceec18 100644 --- a/recipes-ni/nilrt-snac/nilrt-snac_git.bb +++ b/recipes-ni/nilrt-snac/nilrt-snac_git.bb @@ -43,4 +43,5 @@ RDEPENDS:${PN}-ptest += "\ bash \ python3-core \ python3-pytest \ + python3-unittest-automake-output \ " From fb9ef9058ab4790a30a8f3a3fc7d7fac6bdd0f09 Mon Sep 17 00:00:00 2001 From: Alex Stewart Date: Fri, 20 Sep 2024 11:37:29 -0400 Subject: [PATCH 2/3] nilrt-snac: insert nirtcfg bin loc to PATH The nirtcfg utility is installed to a non-standard path, for no good reason. When running the nilrt-snac ptests from an interactive shell, this nonstandard path is already searched. But when the ptests are run from an non-interactive shell, they fail to resolve the path. Add the nonstandard location to the search PATH. Signed-off-by: Alex Stewart --- recipes-ni/nilrt-snac/files/run-ptest | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes-ni/nilrt-snac/files/run-ptest b/recipes-ni/nilrt-snac/files/run-ptest index 22b78ed5..87876bd4 100644 --- a/recipes-ni/nilrt-snac/files/run-ptest +++ b/recipes-ni/nilrt-snac/files/run-ptest @@ -1,7 +1,13 @@ #!/usr/bin/env python3 +import os + import pytest + +# nirtcfg is installed to a non-standard path +os.environ["PATH"] = "/usr/local/natinst/bin:" + os.environ.get("PATH", "") + pytest.main([ "--automake", "/usr/lib/nilrt-snac/tests/integration", From 700d375ec66ec9df507da15fdb5adcc7b7e6a64b Mon Sep 17 00:00:00 2001 From: Alex Stewart Date: Fri, 20 Sep 2024 11:39:07 -0400 Subject: [PATCH 3/3] nilrt-snac: fixup whitespace in nilrt-snac ptest Python files use spaces for indentation. Signed-off-by: Alex Stewart --- recipes-ni/nilrt-snac/files/run-ptest | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-ni/nilrt-snac/files/run-ptest b/recipes-ni/nilrt-snac/files/run-ptest index 87876bd4..6b95c21d 100644 --- a/recipes-ni/nilrt-snac/files/run-ptest +++ b/recipes-ni/nilrt-snac/files/run-ptest @@ -9,6 +9,6 @@ import pytest os.environ["PATH"] = "/usr/local/natinst/bin:" + os.environ.get("PATH", "") pytest.main([ - "--automake", - "/usr/lib/nilrt-snac/tests/integration", + "--automake", + "/usr/lib/nilrt-snac/tests/integration", ])