From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7024137565936549888 X-Received: by 2002:a05:6512:2213:: with SMTP id h19mr4834602lfu.576.1635434470943; Thu, 28 Oct 2021 08:21:10 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:31d4:: with SMTP id j20ls2526846lfe.2.gmail; Thu, 28 Oct 2021 08:21:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDzMXfaVb9Jm/JwSGe4Pig2BUPbDQvo3eLu9wXBHrOPblGNo3Ue9Cim6i6gCTzZgJ0SH+e X-Received: by 2002:a05:6512:3095:: with SMTP id z21mr4900295lfd.262.1635434469817; Thu, 28 Oct 2021 08:21:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635434469; cv=none; d=google.com; s=arc-20160816; b=QKZurGG4mfZJ+eDBGaJaVp0GpP+ULVJPwU1ZfG3Pr+FbtwfwP68T4xVFAI+DcIFm39 Y4ox05vxE0SmUFcmLuPUrj5m8YrSlo83BNkC36AG0lbuOKEqVwng8v/u0OPHapG/n9ms swx2DRdVQuno+O7SKvLozygqoCMOLyRkglN1dbpTj7aIUhSwHdMRILpSH6MhYuCX8/2s N1B7zrWQGFYvkEJaab2tZvyzPLW/H5lVYdxLPdJld+Bdhrx9UnaItdEUQQXmhjISBGeZ bL00szuK4pQCkV/jVAj2c+J4X8b0zHuRE7Me+vm8AryOs/c5M0NIcRTpiW7d2YOdypfJ ZFqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=JH06wGN9d6RIl6QFbM8Hqalefi+8hHFIvTo4IT4Uf0A=; b=BnDWCw4ABdu2XrO1sMkn+tH4q+jWE1AYTHkyUN5Yg6D7VSQvK8gM4Mhk9H15yxe12A xpkToQ+FmrVuCEAzpv+HNGVnh97dx0/CvZ/VjAYnR/i5n2fWNLrYBfWkzP1yLE5+pQkw NGJJ3yHdc+NY+sTsOXak0pIYJA78Iu5DucUhZVLKEPrAbphVhZmkoAkpshi31GAlHI6r 6MPd/9LgAoEIPdr91yJ0eB2bbnqduzGTBfAtIJV5fCZPcGNUrUOBrMSgoh0vU4yIoNjZ q2nVAm7yEHVNw1vpf9UnvtIDmKCOek+GR/noMdfvofpAp5MvBhBhp/zMUIlSc8Pz0AhC 9mEw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id z1si215607lfu.5.2021.10.28.08.21.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Oct 2021 08:21:09 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from localhost.localdomain (mm-42-79-214-37.mgts.dynamic.pppoe.byfly.by [37.214.79.42] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 19SFL5Va017921 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Oct 2021 17:21:06 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH] CI: Add sstate-cache testcase Date: Thu, 28 Oct 2021 18:20:56 +0300 Message-Id: <20211028152056.244471-1-amikan@ilbers.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: 4CUTS9WwZ1uM Test rebuild time improve after cleanup to be sure sstate-cache works. Signed-off-by: Anton Mikanovich --- testsuite/build_test/build_test.py | 40 ++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/testsuite/build_test/build_test.py b/testsuite/build_test/build_test.py index d39c10c0..244f6fc0 100644 --- a/testsuite/build_test/build_test.py +++ b/testsuite/build_test/build_test.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -import os +import os, time from avocado import skipUnless -from avocado.utils import path +from avocado.utils import path, process from cibase import CIBaseTest UMOCI_AVAILABLE = True @@ -206,3 +206,39 @@ class ContainerSdkTest(CIBaseTest): targets = ['mc:container-amd64-stretch:isar-image-base'] self.perform_container_test(targets, 'do_populate_sdk') + +class SstateTest(CIBaseTest): + + """ + Test rebuild speed improve with sstate-cache + + :avocado: tags=sstate + """ + def test_sstate_rebuild(self): + speedup_k = 2.0 + + targets = [ + 'mc:qemuamd64-bullseye:isar-image-base' + ] + + # Cleanup everything before build + build_dir = self.params.get('build_dir', + default=os.path.dirname(__file__) + '/../../build') + process.run('rm -rf ' + build_dir + '/sstate-cache', sudo=True) + self.deletetmp(build_dir) + + start = time.time() + self.perform_build_test(targets, 1, None) + first_time = time.time() - start + self.log.info('Non-cached build:' + str(round(first_time, 2))) + + # Cleanup everything but cache files + self.deletetmp(build_dir) + + start = time.time() + self.perform_build_test(targets, 1, None) + second_time = time.time() - start + self.log.info('Cached build:' + str(round(second_time, 2))) + + if first_time / second_time < speedup_k: + self.fail('No speedup after rebuild with sstate-cache') -- 2.20.1