[oe-commits] [openembedded-core] 10/10: oe-selftest: fix for changes to buildhistory-diff

git at git.openembedded.org git at git.openembedded.org
Mon Jul 23 12:43:52 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 4c1d735c2ccfb7dbe9948b17816ada3b4a26b288
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Mon Jul 23 14:40:14 2018 +0200

    oe-selftest: fix for changes to buildhistory-diff
    
    Now we're not reporting the related fields (as of openembedded-core
    8658b3677b9f7cb70806061c41570c709086ef05) we shouldn't expect to see
    PR reported here since it's not monitored by buildhistory-diff. However,
    with a bit of messing about we can check for the exact output that we
    should now see as a result of the test changing PR to go backwards.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/oescripts.py | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/oescripts.py b/meta/lib/oeqa/selftest/cases/oescripts.py
index 1ee7537..bcdc2d5 100644
--- a/meta/lib/oeqa/selftest/cases/oescripts.py
+++ b/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -10,6 +10,19 @@ class BuildhistoryDiffTests(BuildhistoryBase):
         target = 'xcursor-transparent-theme'
         self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
         self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True)
+        result = runCmd("oe-pkgdata-util read-value PKGV %s" % target)
+        pkgv = result.output.rstrip()
         result = runCmd("buildhistory-diff -p %s" % get_bb_var('BUILDHISTORY_DIR'))
-        expected_output = 'PR changed from "r1" to "r0"'
-        self.assertTrue(expected_output in result.output, msg="Did not find expected output: %s" % result.output)
+        expected_endlines = [
+            "xcursor-transparent-theme-dev: RDEPENDS: removed \"xcursor-transparent-theme (['= %s-r1'])\", added \"xcursor-transparent-theme (['= %s-r0'])\"" % (pkgv, pkgv),
+            "xcursor-transparent-theme-staticdev: RDEPENDS: removed \"xcursor-transparent-theme-dev (['= %s-r1'])\", added \"xcursor-transparent-theme-dev (['= %s-r0'])\"" % (pkgv, pkgv)
+        ]
+        for line in result.output.splitlines():
+            for el in expected_endlines:
+                if line.endswith(el):
+                    expected_endlines.remove(el)
+                    break
+            else:
+                self.fail('Unexpected line:\n%s\nExpected line endings:\n  %s' % (line, '\n  '.join(expected_endlines)))
+        if expected_endlines:
+            self.fail('Missing expected line endings:\n  %s' % '\n  '.join(expected_endlines))

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list