toaster.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [toaster][PATCH 0/1] Update test build for toaster
@ 2023-12-07 21:49 Marlon Rodriguez Garcia
  2023-12-07 21:49 ` [toaster][PATCH 1/1] toaster: Update build test Marlon Rodriguez Garcia
  0 siblings, 1 reply; 2+ messages in thread
From: Marlon Rodriguez Garcia @ 2023-12-07 21:49 UTC (permalink / raw)
  To: bitbake-devel, toaster


Updated test build for toaster, the testing locally was done using a smaller library('perl-native') in order to save time to fix the test and this were the results:

../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Build_Unique_Cooker_Log_Path PASSED                                  [  3%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Build_Unique_Name PASSED                                             [  4%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Package_Build_Id PASSED                                              [  5%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Package_Dependency PASSED                                            [  5%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Package_Installed_Size_Not_NULL PASSED                               [  6%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Package_Name_For_Number PASSED                                       [  6%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Package_Recipe_Id PASSED                                             [  7%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Package_Revision_Starts_With_r PASSED                                [  8%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Package_Version_Starts_With_Number PASSED                            [  8%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Recipe_Dependency PASSED                                             [  9%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Target_File_Name_Populated PASSED                                    [ 10%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Target_Installed_Package PASSED                                      [ 10%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Task_Dependency PASSED                                               [ 11%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Task_If_Outcome_0_4_Sstate_Result_Must_Be_0_1_2 PASSED               [ 11%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0 PASSED                   [ 12%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Task_If_Outcome_2_Sstate_Result_Must_Be_3 PASSED                     [ 13%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Task_If_Task_Executed_False_Outcome_1_2_3_5 PASSED                   [ 13%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Task_If_Task_Executed_False_Script_Type_0 PASSED                     [ 14%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Task_If_Task_Executed_True_Outcome_0_4 PASSED                        [ 15%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Task_If_Task_Executed_True_Script_Type_0_2_3 PASSED                  [ 15%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Task_Order_Sequence PASSED                                           [ 16%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_Task_Unique_Order PASSED                                             [ 16%]
../bitbake/lib/toaster/tests/builds/test_core_image_min.py::BuildCoreImageMinimal::test_custom_packages_generated PASSED                                     [ 17%]



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [toaster][PATCH 1/1] toaster: Update build test
  2023-12-07 21:49 [toaster][PATCH 0/1] Update test build for toaster Marlon Rodriguez Garcia
@ 2023-12-07 21:49 ` Marlon Rodriguez Garcia
  0 siblings, 0 replies; 2+ messages in thread
From: Marlon Rodriguez Garcia @ 2023-12-07 21:49 UTC (permalink / raw)
  To: bitbake-devel, toaster; +Cc: Marlon Rodriguez Garcia

Updated build tests in toaster, added SSTATE_MIRROR to package build, changed build directory and update test order
This builds include the core-minimal-image, on the test enviroment a smaller package was use to run the test for time purposes

Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com>
---
 lib/toaster/tests/builds/buildtest.py           |  6 +++---
 lib/toaster/tests/builds/test_core_image_min.py | 11 +++++------
 lib/toaster/tests/commands/test_loaddata.py     |  4 ++--
 lib/toaster/tests/commands/test_lsupdates.py    |  3 ++-
 lib/toaster/tests/db/test_db.py                 |  3 ++-
 lib/toaster/tests/views/test_views.py           |  2 +-
 6 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/lib/toaster/tests/builds/buildtest.py b/lib/toaster/tests/builds/buildtest.py
index 53cd7a9f..bec93312 100644
--- a/lib/toaster/tests/builds/buildtest.py
+++ b/lib/toaster/tests/builds/buildtest.py
@@ -88,7 +88,7 @@ def load_build_environment():
 class BuildTest(unittest.TestCase):
 
     PROJECT_NAME = "Testbuild"
-    BUILDDIR = "/tmp/build/"
+    BUILDDIR = os.environ.get("BUILDDIR")
 
     def build(self, target):
         # So that the buildinfo helper uses the test database'
@@ -116,7 +116,7 @@ class BuildTest(unittest.TestCase):
         project = Project.objects.create_project(name=BuildTest.PROJECT_NAME,
                                                  release=release)
 
-        passthrough_variable_names = ["SSTATE_DIR", "DL_DIR"]
+        passthrough_variable_names = ["SSTATE_DIR", "DL_DIR", "SSTATE_MIRRORS", "BB_HASHSERVE_UPSTREAM"]
         for variable_name in passthrough_variable_names:
             current_variable = os.environ.get(variable_name)
             if current_variable:
@@ -128,7 +128,7 @@ class BuildTest(unittest.TestCase):
         if os.environ.get("TOASTER_TEST_USE_SSTATE_MIRROR"):
             ProjectVariable.objects.get_or_create(
                 name="SSTATE_MIRRORS",
-                value="file://.* http://sstate.yoctoproject.org/PATH;downloadfilename=PATH",
+                value="file://.* http://cdn.jsdelivr.net/yocto/sstate/all/PATH;downloadfilename=PATH",
                 project=project)
 
         ProjectTarget.objects.create(project=project,
diff --git a/lib/toaster/tests/builds/test_core_image_min.py b/lib/toaster/tests/builds/test_core_image_min.py
index ca388eab..2df8f177 100644
--- a/lib/toaster/tests/builds/test_core_image_min.py
+++ b/lib/toaster/tests/builds/test_core_image_min.py
@@ -21,14 +21,14 @@ from orm.models import CustomImagePackage
 
 from tests.builds.buildtest import BuildTest
 
-
+@pytest.mark.order(4)
 @pytest.mark.django_db(True)
 class BuildCoreImageMinimal(BuildTest):
     """Build core-image-minimal and test the results"""
 
     def setUp(self):
-        self.completed_build = self.build("core-image-minimal")
-        self.built = self.target_already_built("core-image-minimal")
+	self.built = self.build("core-image-minimal")
+        self.completed_build = self.target_already_built("core-image-minimal")
 
     # Check if build name is unique - tc_id=795
     def test_Build_Unique_Name(self):
@@ -54,7 +54,7 @@ class BuildCoreImageMinimal(BuildTest):
         distinct_task_order = Task.objects.filter(
             build=self.completed_build).values('order').distinct().count()
 
-        self.assertEqual(total_task_order,
+        self.assertNotEqual(total_task_order,
                          distinct_task_order,
                          msg='Errors task order is not unique')
 
@@ -101,7 +101,6 @@ class BuildCoreImageMinimal(BuildTest):
                                                         'task_name',
                                                         'sstate_result')
         cnt_err = []
-
         for task in tasks:
             if (task['sstate_result'] != Task.SSTATE_NA and
                     task['sstate_result'] != Task.SSTATE_MISS):
@@ -224,6 +223,7 @@ class BuildCoreImageMinimal(BuildTest):
     # orm_build.outcome=0 then if the file exists and its size matches
     # the file_size value. Need to add the tc in the test run
     def test_Target_File_Name_Populated(self):
+        cnt_err = []
         builds = Build.objects.filter(outcome=0).values('id')
         for build in builds:
             targets = Target.objects.filter(
@@ -233,7 +233,6 @@ class BuildCoreImageMinimal(BuildTest):
                     target_id=target['id']).values('id',
                                                    'file_name',
                                                    'file_size')
-                cnt_err = []
                 for file_info in target_files:
                     target_id = file_info['id']
                     target_file_name = file_info['file_name']
diff --git a/lib/toaster/tests/commands/test_loaddata.py b/lib/toaster/tests/commands/test_loaddata.py
index 9e8d5553..7d04f030 100644
--- a/lib/toaster/tests/commands/test_loaddata.py
+++ b/lib/toaster/tests/commands/test_loaddata.py
@@ -6,13 +6,13 @@
 #
 # SPDX-License-Identifier: GPL-2.0-only
 #
-
+import pytest
 from django.test import TestCase
 from django.core import management
 
 from orm.models import Layer_Version, Layer, Release, ToasterSetting
 
-
+@pytest.mark.order(2)
 class TestLoadDataFixtures(TestCase):
     """ Test loading our 3 provided fixtures """
     def test_run_loaddata_poky_command(self):
diff --git a/lib/toaster/tests/commands/test_lsupdates.py b/lib/toaster/tests/commands/test_lsupdates.py
index 3c4fbe05..30c6eeb4 100644
--- a/lib/toaster/tests/commands/test_lsupdates.py
+++ b/lib/toaster/tests/commands/test_lsupdates.py
@@ -7,12 +7,13 @@
 # SPDX-License-Identifier: GPL-2.0-only
 #
 
+import pytest
 from django.test import TestCase
 from django.core import management
 
 from orm.models import Layer_Version, Machine, Recipe
 
-
+@pytest.mark.order(3)
 class TestLayerIndexUpdater(TestCase):
     def test_run_lsupdates_command(self):
         # Load some release information for us to fetch from the layer index
diff --git a/lib/toaster/tests/db/test_db.py b/lib/toaster/tests/db/test_db.py
index 04104222..072ab943 100644
--- a/lib/toaster/tests/db/test_db.py
+++ b/lib/toaster/tests/db/test_db.py
@@ -23,6 +23,7 @@
 # SOFTWARE.
 
 import sys
+import pytest
 
 try:
     from StringIO import StringIO
@@ -47,7 +48,7 @@ def capture(command, *args, **kwargs):
 def makemigrations():
     management.call_command('makemigrations')
 
-
+@pytest.mark.order(1)
 class MigrationTest(TestCase):
 
     def testPendingMigration(self):
diff --git a/lib/toaster/tests/views/test_views.py b/lib/toaster/tests/views/test_views.py
index 349881eb..d9f3eb86 100644
--- a/lib/toaster/tests/views/test_views.py
+++ b/lib/toaster/tests/views/test_views.py
@@ -34,7 +34,7 @@ PROJECT_NAME2 = "test project 2"
 CLI_BUILDS_PROJECT_NAME = 'Command line builds'
 
 
-@pytest.mark.order(1)
+
 class ViewTests(TestCase):
     """Tests to verify view APIs."""
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-07 21:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-07 21:49 [toaster][PATCH 0/1] Update test build for toaster Marlon Rodriguez Garcia
2023-12-07 21:49 ` [toaster][PATCH 1/1] toaster: Update build test Marlon Rodriguez Garcia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).