From 67be7cf82ba205092c0a3cdd41df5b2a96d444fd Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Mon, 18 Dec 2023 09:43:58 +0100 Subject: selftest/sstatetests: fix up printdiff test to match rework of printdiff logic Other than the formatting changes, there are two functional ones: - use perlcross instead of quilt, as quilt is special in the sense of being excluded from task hash calculcations. perlcross is a full participant. - run the full test (local + sstate) for gcc do_preconfiure change as the necessary fix has been implemented (sstatesig/find_siginfo: special-case gcc-source when looking in sstate caches) Note that when several tasks are found to have changed (as is the case when base do_configure is adjusted), find_siginfo() runs glob.glob("*/*/*taskname*") against autobuilder sstate cache for each of those tasks (six or seven times). This is an expensive operation taking several minutes. I left it in for now, but if it's proven too slow the test would have to be reduced to checking a specific base recipe (e.g. zstd-native) rather than a distant image target. [YOCTO #15289] (From OE-Core rev: 0ef7cf324718412c5b6c376acfbc4079ecd7d465) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- .../recipes-test/perlcross/perlcross_%.bbappend | 2 ++ .../quilt-native/quilt-native_%.bbappend | 2 -- meta/lib/oeqa/selftest/cases/sstatetests.py | 22 +++++++++++++--------- 3 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 meta-selftest/recipes-test/perlcross/perlcross_%.bbappend delete mode 100644 meta-selftest/recipes-test/quilt-native/quilt-native_%.bbappend diff --git a/meta-selftest/recipes-test/perlcross/perlcross_%.bbappend b/meta-selftest/recipes-test/perlcross/perlcross_%.bbappend new file mode 100644 index 0000000000..205720982c --- /dev/null +++ b/meta-selftest/recipes-test/perlcross/perlcross_%.bbappend @@ -0,0 +1,2 @@ +# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests. +include test_recipe.inc diff --git a/meta-selftest/recipes-test/quilt-native/quilt-native_%.bbappend b/meta-selftest/recipes-test/quilt-native/quilt-native_%.bbappend deleted file mode 100644 index 205720982c..0000000000 --- a/meta-selftest/recipes-test/quilt-native/quilt-native_%.bbappend +++ /dev/null @@ -1,2 +0,0 @@ -# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests. -include test_recipe.inc diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py index 393eaf6339..4972ff70ca 100644 --- a/meta/lib/oeqa/selftest/cases/sstatetests.py +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py @@ -820,14 +820,16 @@ TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-difftmp-{}" # Check if printdiff walks the full dependency chain from the image target to where the change is in a specific recipe - def test_image_minimal_vs_quilt(self): - expected_output = ("Task quilt-native:do_install couldn't be used from the cache because:", + def test_image_minimal_vs_perlcross(self): + expected_output = ("Task perlcross-native:do_install couldn't be used from the cache because:", "We need hash", "most recent matching task was") - expected_sametmp_output = expected_output + ("Variable do_install value changed",'+ echo "this changes the task signature"') + expected_sametmp_output = expected_output + ( +"Variable do_install value changed", +'+ echo "this changes the task signature"') expected_difftmp_output = expected_output - self.run_test_printdiff_changerecipe("core-image-minimal", "quilt-native", "-c do_install quilt-native", + self.run_test_printdiff_changerecipe("core-image-minimal", "perlcross", "-c do_install perlcross-native", """ do_install:append() { echo "this changes the task signature" @@ -842,10 +844,10 @@ expected_sametmp_output, expected_difftmp_output) expected_output = ("Task {}:do_preconfigure couldn't be used from the cache because:".format(gcc_source_pn), "We need hash", "most recent matching task was") - expected_sametmp_output = expected_output + ("Variable do_preconfigure value changed",'+ print("this changes the task signature")') - #FIXME: printdiff is supposed to find at least one preconfigure task signature in the sstate cache, but isn't able to - #expected_difftmp_output = expected_output - expected_difftmp_output = () + expected_sametmp_output = expected_output + ( +"Variable do_preconfigure value changed", +'+ print("this changes the task signature")') + expected_difftmp_output = expected_output self.run_test_printdiff_changerecipe("gcc-runtime", "gcc-source", "-c do_preconfigure {}".format(gcc_source_pn), """ @@ -869,7 +871,9 @@ expected_sametmp_output, expected_difftmp_output) "Task gnu-config-native:do_configure couldn't be used from the cache because:", "We need hash", "most recent matching task was") - expected_sametmp_output = expected_output + ("Variable base_do_configure value changed",'+ echo "this changes base_do_configure() definiton "') + expected_sametmp_output = expected_output + ( +"Variable base_do_configure value changed", +'+ echo "this changes base_do_configure() definiton "') expected_difftmp_output = expected_output self.run_test_printdiff_changeconfig("core-image-minimal", -- cgit v1.2.3-54-g00ecf