mirror of
https://git.yoctoproject.org/poky
synced 2026-04-19 06:32:13 +02:00
bitbake: toaster/tests: Update build test
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 (Bitbake rev: af31116f0017912fc5a58a5976c814b6b326985f) Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
1b14962c3f
commit
ad2f5a359e
@@ -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,
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user