The rework changes the console output significantly: where previously
printdiff would report the most basic invalid tasks it could find,
with this change the most top-level tasks are reported instead. This
is not a problem as diffsigs has its own task recursion facility, and will
track down the actual change anyway. However the changes still need to be 
reflected
in the selftests.

Note that printdiff is run on one specific target task rather than
overall do_build for a recipe. Otherwise find_siginfo would run
glob.glob("*/*/*taskname*") against autobuilder sstate cache for each
of those tasks (six or seven times) - this is an expensive operation
taking several minutes, and it's best to do it only once per test.

[YOCTO #15289]

Signed-off-by: Alexander Kanavin <[email protected]>
---
 .../perlcross_%.bbappend}                     |  0
 meta/lib/oeqa/selftest/cases/sstatetests.py   | 40 +++++++++----------
 2 files changed, 18 insertions(+), 22 deletions(-)
 rename meta-selftest/recipes-test/{quilt-native/quilt-native_%.bbappend => 
perlcross/perlcross_%.bbappend} (100%)

diff --git a/meta-selftest/recipes-test/quilt-native/quilt-native_%.bbappend 
b/meta-selftest/recipes-test/perlcross/perlcross_%.bbappend
similarity index 100%
rename from meta-selftest/recipes-test/quilt-native/quilt-native_%.bbappend
rename to meta-selftest/recipes-test/perlcross/perlcross_%.bbappend
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py 
b/meta/lib/oeqa/selftest/cases/sstatetests.py
index f52ca77c09c..f5b3437d86b 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -824,14 +824,17 @@ 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 core-image-minimal:do_create_spdx 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 + (
+"Hash for task dependency perlcross-native:do_install changed from",
+"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:do_create_spdx", 
"perlcross", "-c do_install perlcross-native",
 """
 do_install:append() {
     echo "this changes the task signature"
@@ -843,15 +846,15 @@ expected_sametmp_output, expected_difftmp_output)
     def test_gcc_runtime_vs_gcc_source(self):
         gcc_source_pn = 'gcc-source-%s' % get_bb_vars(['PV'], 'gcc')['PV']
 
-        expected_output = ("Task {}:do_preconfigure couldn't be used from the 
cache because:".format(gcc_source_pn),
+        expected_output = ("Task gcc-runtime:do_package_write_rpm couldn't be 
used from the cache because:",
 "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 + ("Hash for task dependency 
{}:do_preconfigure changed from".format(gcc_source_pn),
+"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),
+        
self.run_test_printdiff_changerecipe("gcc-runtime:do_package_write_rpm", 
"gcc-source", "-c do_preconfigure {}".format(gcc_source_pn),
 """
 python do_preconfigure:append() {
     print("this changes the task signature")
@@ -861,22 +864,15 @@ expected_sametmp_output, expected_difftmp_output)
 
     # Check if changing a really base task definiton is reported against 
multiple core recipes using it
     def test_image_minimal_vs_base_do_configure(self):
-        expected_output = ("Task zstd-native:do_configure couldn't be used 
from the cache because:",
-"Task texinfo-dummy-native:do_configure couldn't be used from the cache 
because:",
-"Task ldconfig-native:do_configure couldn't be used from the cache because:",
-"Task gettext-minimal-native:do_configure couldn't be used from the cache 
because:",
-"Task tzcode-native:do_configure couldn't be used from the cache because:",
-"Task makedevs-native:do_configure couldn't be used from the cache because:",
-"Task pigz-native:do_configure couldn't be used from the cache because:",
-"Task update-rc.d-native:do_configure couldn't be used from the cache 
because:",
-"Task unzip-native:do_configure couldn't be used from the cache because:",
-"Task gnu-config-native:do_configure couldn't be used from the cache because:",
+        expected_output = ("Task core-image-minimal:do_populate_lic_deploy 
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 + ("Hash for task dependency 
gnu-config-native:do_configure changed from",
+"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",
+        
self.run_test_printdiff_changeconfig("core-image-minimal:do_populate_lic_deploy",
 """
 INHERIT += "base-do-configure-modified"
 """,
-- 
2.39.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192375): 
https://lists.openembedded.org/g/openembedded-core/message/192375
Mute This Topic: https://lists.openembedded.org/mt/103169698/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to