* [PATCH] oeqa/selftest/buildoptions: Test build does not fail without git rev
@ 2016-02-15 16:49 Daniel Istrate
2016-02-26 16:08 ` Burton, Ross
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Istrate @ 2016-02-15 16:49 UTC (permalink / raw)
To: openembedded-core
Test that layer git revisions are displayed and
do not fail without git repository.
fix for [YOCTO #8852]
Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
---
meta/lib/oeqa/selftest/buildoptions.py | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
index 6167fb2..80b59bd 100644
--- a/meta/lib/oeqa/selftest/buildoptions.py
+++ b/meta/lib/oeqa/selftest/buildoptions.py
@@ -1,7 +1,7 @@
import os
import re
import glob as g
-
+import shutil
from oeqa.selftest.base import oeSelfTest
from oeqa.selftest.buildhistory import BuildhistoryBase
from oeqa.utils.commands import runCmd, bitbake, get_bb_var
@@ -103,6 +103,36 @@ class SanityOptionsTest(oeSelfTest):
self.assertTrue("WARNING: QA Issue: gzip" in res.output, "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output)
self.assertTrue("WARNING: QA Issue: nfs-utils" in res.output, "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output)
+ @testcase(1421)
+ def test_layer_git_revisions_are_displayed_and_do_not_fail_without_git_repo(self):
+ """
+ Summary: Test that layer git revisions are displayed and do not fail without git repository
+ Expected: The build to be successful and without "fatal" errors
+ Product: oe-core
+ Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ test_recipe = 'ed'
+ corebase = get_bb_var('COREBASE')
+ git_dir = os.path.join(corebase, '.git')
+ git_dir_tmp = os.path.join(corebase, '.git_tmp')
+
+ bitbake('-n %s' % test_recipe)
+ shutil.move(git_dir, git_dir_tmp)
+
+ self.add_command_to_tearDown('mv %s %s' % (git_dir_tmp, git_dir))
+
+ ret = bitbake('-n %s' % test_recipe)
+
+ patt = r'fatal: Not a git repository \(or any parent up to mount point /home\)\n' \
+ r'Stopping at filesystem boundary \(GIT_DISCOVERY_ACROSS_FILESYSTEM not set\)\.'
+
+ found_err = re.search(patt, ret.output)
+
+ self.assertIsNone(found_err, 'Fatal errors found. Output: %s' % ret.output)
+
+
class BuildhistoryTests(BuildhistoryBase):
@testcase(293)
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] oeqa/selftest/buildoptions: Test build does not fail without git rev
2016-02-15 16:49 [PATCH] oeqa/selftest/buildoptions: Test build does not fail without git rev Daniel Istrate
@ 2016-02-26 16:08 ` Burton, Ross
0 siblings, 0 replies; 2+ messages in thread
From: Burton, Ross @ 2016-02-26 16:08 UTC (permalink / raw)
To: Daniel Istrate; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 245 bytes --]
On 15 February 2016 at 16:49, Daniel Istrate <
daniel.alexandrux.istrate@intel.com> wrote:
> + shutil.move(git_dir, git_dir_tmp)
>
This is a bit scary. I think the test should use yocto-layers to create an
empty layer.
Ross
[-- Attachment #2: Type: text/html, Size: 700 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-26 16:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-15 16:49 [PATCH] oeqa/selftest/buildoptions: Test build does not fail without git rev Daniel Istrate
2016-02-26 16:08 ` Burton, Ross
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.