[meta-zephyr] [PATCH 1/2] zephyrtest: Enable use of TESTIMAGE_AUTO


Peter Hoyes
 

From: Peter Hoyes <Peter.Hoyes@...>

When TESTIMAGE_AUTO is enabled, the do_testimage task is inserted after
do_image_complete and before do_build so that the test suites
automatically run as part of the image build.

However, do_testdata_write is currently constrained to run only before
do_build, so it likely won't execute prior to do_testimage. Change the
"before" constraint to do_testimage do that the testdata is always
generated prior to running the testimage task.

Signed-off-by: Peter Hoyes <Peter.Hoyes@...>
---
meta-zephyr-core/classes/zephyrtest.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-zephyr-core/classes/zephyrtest.bbclass b/meta-zephyr-co=
re/classes/zephyrtest.bbclass
index 248fd15..aa48e6c 100644
--- a/meta-zephyr-core/classes/zephyrtest.bbclass
+++ b/meta-zephyr-core/classes/zephyrtest.bbclass
@@ -50,4 +50,4 @@ python testdata_clean() {
os.remove(fname)
}
=20
-addtask do_testdata_write before do_build after do_deploy
+addtask do_testdata_write before do_testimage after do_deploy
--=20
2.25.1


Jon Mason
 

On Tue, Jul 26, 2022 at 11:18 AM Peter Hoyes <peter.hoyes@...> wrote:

From: Peter Hoyes <Peter.Hoyes@...>

When TESTIMAGE_AUTO is enabled, the do_testimage task is inserted after
do_image_complete and before do_build so that the test suites
automatically run as part of the image build.

However, do_testdata_write is currently constrained to run only before
do_build, so it likely won't execute prior to do_testimage. Change the
"before" constraint to do_testimage do that the testdata is always
generated prior to running the testimage task.

Signed-off-by: Peter Hoyes <Peter.Hoyes@...>
This series passed CI and is a fantastic improvement
https://gitlab.com/jonmason00/meta-zephyr/-/pipelines/597428786

---
meta-zephyr-core/classes/zephyrtest.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-zephyr-core/classes/zephyrtest.bbclass b/meta-zephyr-core/classes/zephyrtest.bbclass
index 248fd15..aa48e6c 100644
--- a/meta-zephyr-core/classes/zephyrtest.bbclass
+++ b/meta-zephyr-core/classes/zephyrtest.bbclass
@@ -50,4 +50,4 @@ python testdata_clean() {
os.remove(fname)
}

-addtask do_testdata_write before do_build after do_deploy
+addtask do_testdata_write before do_testimage after do_deploy
--
2.25.1