public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/4] oeqa.buildperf: make tests independent
Date: Fri, 26 Aug 2016 10:33:09 +0300	[thread overview]
Message-ID: <1472196791-24336-3-git-send-email-markus.lehtonen@linux.intel.com> (raw)
In-Reply-To: <1472196791-24336-1-git-send-email-markus.lehtonen@linux.intel.com>

Add test set-up functionality so that the individual tests do not depend
on each other. This should make sure that a failure in one test does not
affect the results of another test. The patch also makes it reasonable
to run only a subset of the tests by using the --run-tests option.

The increase in total execution time of the full suite - caused by the
additional set-up steps - is insignificant because normally no
additional tasks need to be run. The previous test has already done all
set-up work.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 meta/lib/oeqa/buildperf/base.py       |  7 +++++++
 meta/lib/oeqa/buildperf/test_basic.py | 10 +++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index e4a7948..83439f1 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -257,6 +257,7 @@ class BuildPerfTestCase(unittest.TestCase):
     """Base class for build performance tests"""
     SYSRES = 'sysres'
     DISKUSAGE = 'diskusage'
+    build_target = None
 
     def __init__(self, *args, **kwargs):
         super(BuildPerfTestCase, self).__init__(*args, **kwargs)
@@ -271,6 +272,12 @@ class BuildPerfTestCase(unittest.TestCase):
         self.times = []
         self.sizes = []
 
+    def setUp(self):
+        """Set-up fixture for each test"""
+        if self.build_target:
+            self.log_cmd_output(['bitbake', self.build_target,
+                                 '-c', 'fetchall'])
+
     def run(self, *args, **kwargs):
         """Run test"""
         self.start_time = datetime.now()
diff --git a/meta/lib/oeqa/buildperf/test_basic.py b/meta/lib/oeqa/buildperf/test_basic.py
index 9310f3d..25dbfb0 100644
--- a/meta/lib/oeqa/buildperf/test_basic.py
+++ b/meta/lib/oeqa/buildperf/test_basic.py
@@ -23,7 +23,6 @@ class Test1P1(BuildPerfTestCase):
 
     def test1(self):
         """Measure wall clock of bitbake core-image-sato and size of tmp dir"""
-        self.log_cmd_output("bitbake {} -c fetchall".format(self.build_target))
         self.rm_tmp()
         self.rm_sstate()
         self.rm_cache()
@@ -39,8 +38,10 @@ class Test1P2(BuildPerfTestCase):
 
     def test12(self):
         """Measure bitbake virtual/kernel"""
-        self.log_cmd_output("bitbake {} -c cleansstate".format(
-            self.build_target))
+        # Build and cleans state in order to get all dependencies pre-built
+        self.log_cmd_output(['bitbake', self.build_target])
+        self.log_cmd_output(['bitbake', self.build_target, '-c', 'cleansstate'])
+
         self.sync()
         self.measure_cmd_resources(['bitbake', self.build_target], 'build',
                                    'bitbake ' + self.build_target)
@@ -73,6 +74,9 @@ class Test2(BuildPerfTestCase):
 
     def test2(self):
         """Measure bitbake core-image-sato -c rootfs with sstate"""
+        # Build once in order to populate sstate cache
+        self.log_cmd_output(['bitbake', self.build_target])
+
         self.rm_tmp()
         self.rm_cache()
         self.sync()
-- 
2.6.6



  parent reply	other threads:[~2016-08-26  7:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26  7:33 [PATCH 0/4] oe-build-perf-test: remove inter-dependencies of tests Markus Lehtonen
2016-08-26  7:33 ` [PATCH 1/4] oeqa.buildperf: fix checking of invalid results Markus Lehtonen
2016-08-26  7:33 ` Markus Lehtonen [this message]
2016-08-26  7:33 ` [PATCH 3/4] oeqa.buildperf: treat failed measurements as errors Markus Lehtonen
2016-08-26  7:33 ` [PATCH 4/4] oe-build-perf-test: update globalres and git even if tests failed Markus Lehtonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472196791-24336-3-git-send-email-markus.lehtonen@linux.intel.com \
    --to=markus.lehtonen@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox