| Summary: | oe-selftest: devtool tests don't preserve command output for showing on failure | ||
|---|---|---|---|
| Product: | [QA/Testing] Build Testing | Reporter: | Paul Eggleton <bluelightning> |
| Component: | general | Assignee: | yeoh ee peng <ee.peng.yeoh> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | benjamin.esquivel, sgw |
| Version: | unspecified | ||
| Target Milestone: | 4.99 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
DevtoolTests had been enhanced, it was no longer using assertTrue and the last run command output had been used in the assertion fails.
result = runCmd('devtool modify mdadm -x %s' % tempdir)
self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found')
self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created')
matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'mdadm_*.bbappend'))
self.assertTrue(matches, 'bbappend not created %s' % result.output)
DevtoolTests.test_devtool_modify had been enhanced by community, it was no longer using assertTrue and the last run command output had been used in the assertion fails.
result = runCmd('devtool modify mdadm -x %s' % tempdir)
self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found')
self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created')
matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'mdadm_*.bbappend'))
self.assertTrue(matches, 'bbappend not created %s' % result.output)
|
If a test fails, e.g. devtool.DevtoolTests.test_devtool_modify because the expected source file wasn't extracted, then we never see the actual devtool command output which might have been useful: ====================================================================== FAIL [33.107s]: test_devtool_modify (oeqa.selftest.devtool.DevtoolTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/media/build1/poky/meta/lib/oeqa/utils/decorators.py", line 109, in wrapped_f return func(*args, **kwargs) File "/media/build1/poky/meta/lib/oeqa/selftest/devtool.py", line 446, in test_devtool_modify self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found') AssertionError: False is not true : Extracted source could not be found ====================================================================== We should change the devtool tests to be printing out the output from the last run command when the assertion fails. (I've filed bug 11356 for the "false is not true" nonsense, so ignore that for now).