Rename OBSLocal.StagingWorkflow to OBSLocal.FactoryWorkflow

This commit is contained in:
Ancor Gonzalez Sosa 2021-08-25 12:13:56 +02:00
parent d2e3c9d2c1
commit 28c771927a
17 changed files with 19 additions and 19 deletions

View File

@ -170,7 +170,7 @@ class TestCase(unittest.TestCase):
return prefix + ''.join([random.choice(string.ascii_letters) for i in range(length)]) return prefix + ''.join([random.choice(string.ascii_letters) for i in range(length)])
class StagingWorkflow(object): class FactoryWorkflow(object):
"""This class is intended to setup and manipulate the environment (projects, users, etc.) in """This class is intended to setup and manipulate the environment (projects, users, etc.) in
the local OBS instance used to tests the release tools. It makes easy to setup scenarios similar the local OBS instance used to tests the release tools. It makes easy to setup scenarios similar
to the ones used during the real (open)SUSE development, with staging projects, rings, etc. to the ones used during the real (open)SUSE development, with staging projects, rings, etc.

View File

@ -11,7 +11,7 @@ class TestReviewBotComment(OBSLocal.TestCase):
def setUp(self): def setUp(self):
super(TestReviewBotComment, self).setUp() super(TestReviewBotComment, self).setUp()
self.api = CommentAPI(self.apiurl) self.api = CommentAPI(self.apiurl)
self.wf = OBSLocal.StagingWorkflow() self.wf = OBSLocal.FactoryWorkflow()
self.wf.create_user('factory-auto') self.wf.create_user('factory-auto')
self.project = self.wf.create_project(PROJECT) self.project = self.wf.create_project(PROJECT)

View File

@ -13,7 +13,7 @@ from . import OBSLocal
class TestAccept(unittest.TestCase): class TestAccept(unittest.TestCase):
def setup_wf(self): def setup_wf(self):
wf = OBSLocal.StagingWorkflow() wf = OBSLocal.FactoryWorkflow()
wf.setup_rings() wf.setup_rings()
self.c_api = CommentAPI(wf.api.apiurl) self.c_api = CommentAPI(wf.api.apiurl)

View File

@ -17,7 +17,7 @@ class TestApiCalls(OBSLocal.TestCase):
def setUp(self): def setUp(self):
super(TestApiCalls, self).setUp() super(TestApiCalls, self).setUp()
self.wf = OBSLocal.StagingWorkflow() self.wf = OBSLocal.FactoryWorkflow()
self.wf.setup_rings() self.wf.setup_rings()
self.staging_b = self.wf.create_staging('B') self.staging_b = self.wf.create_staging('B')
prj = self.staging_b.name prj = self.staging_b.name

View File

@ -5,7 +5,7 @@ class TestBuildFailReminder(OBSLocal.TestCase):
script = './build-fail-reminder.py' script = './build-fail-reminder.py'
def test_basic(self): def test_basic(self):
self.wf = OBSLocal.StagingWorkflow() self.wf = OBSLocal.FactoryWorkflow()
self.wf.create_target() self.wf.create_target()
self.execute_script(['--relay', 'smtp', '--sender', 'Tester']) self.execute_script(['--relay', 'smtp', '--sender', 'Tester'])

View File

@ -23,8 +23,8 @@ class TestCheckSource(OBSLocal.TestCase):
def setUp(self): def setUp(self):
super(TestCheckSource, self).setUp() super(TestCheckSource, self).setUp()
# Using OBSLocal.StagingWorkflow makes it easier to setup testing scenarios # Using OBSLocal.FactoryWorkflow makes it easier to setup testing scenarios
self.wf = OBSLocal.StagingWorkflow(PROJECT) self.wf = OBSLocal.FactoryWorkflow(PROJECT)
self.project = self.wf.projects[PROJECT] self.project = self.wf.projects[PROJECT]
# Set up the reviewers team # Set up the reviewers team

View File

@ -24,7 +24,7 @@ class TestCheckCommand(unittest.TestCase):
def test_check_command_single(self): def test_check_command_single(self):
"""Validate json conversion for a single project.""" """Validate json conversion for a single project."""
wf = OBSLocal.StagingWorkflow() wf = OBSLocal.FactoryWorkflow()
wf.create_staging('H') wf.create_staging('H')
self.checkcommand = CheckCommand(wf.api) self.checkcommand = CheckCommand(wf.api)

View File

@ -93,7 +93,7 @@ handle
class TestCommentOBS(OBSLocal.TestCase): class TestCommentOBS(OBSLocal.TestCase):
def setUp(self): def setUp(self):
super(TestCommentOBS, self).setUp() super(TestCommentOBS, self).setUp()
self.wf = OBSLocal.StagingWorkflow() self.wf = OBSLocal.FactoryWorkflow()
self.wf.create_user('factory-auto') self.wf.create_user('factory-auto')
self.wf.create_user('repo-checker') self.wf.create_user('repo-checker')
self.wf.create_user('staging-bot') self.wf.create_user('staging-bot')

View File

@ -9,7 +9,7 @@ from . import OBSLocal
class TestConfig(unittest.TestCase): class TestConfig(unittest.TestCase):
def setup_vcr(self): def setup_vcr(self):
return OBSLocal.StagingWorkflow() return OBSLocal.FactoryWorkflow()
def test_basic(self): def test_basic(self):
wf = self.setup_vcr() wf = self.setup_vcr()

View File

@ -7,7 +7,7 @@ class TestDevelProject(OBSLocal.TestCase):
def setUp(self): def setUp(self):
super().setUp() super().setUp()
self.wf = OBSLocal.StagingWorkflow() self.wf = OBSLocal.FactoryWorkflow()
spa = self.wf.create_project('server:php:applications') spa = self.wf.create_project('server:php:applications')
OBSLocal.Package('drush', project=spa) OBSLocal.Package('drush', project=spa)
OBSLocal.Package('drush', self.wf.projects['target'], devel_project='server:php:applications') OBSLocal.Package('drush', self.wf.projects['target'], devel_project='server:php:applications')

View File

@ -41,8 +41,8 @@ class TestFactorySubmitRequest(OBSLocal.TestCase):
super(TestFactorySubmitRequest, self).setUp() super(TestFactorySubmitRequest, self).setUp()
# Setup the basic scenario, with manual reviewers, staging projects, rings and wine as # Setup the basic scenario, with manual reviewers, staging projects, rings and wine as
# example package (wine is in ring1, see OBSLocal.StagingWorkflow.setup_rings) # example package (wine is in ring1, see OBSLocal.FactoryWorkflow.setup_rings)
self.wf = OBSLocal.StagingWorkflow(PROJECT) self.wf = OBSLocal.FactoryWorkflow(PROJECT)
self.__setup_review_team() self.__setup_review_team()
self.__setup_devel_package('wine') self.__setup_devel_package('wine')
self.wf.setup_rings(devel_project=DEVEL_PROJECT) self.wf.setup_rings(devel_project=DEVEL_PROJECT)

View File

@ -24,7 +24,7 @@ class TestFreeze(OBSLocal.TestCase):
return os.path.join(os.getcwd(), 'tests/fixtures') return os.path.join(os.getcwd(), 'tests/fixtures')
def test_bootstrap_copy(self): def test_bootstrap_copy(self):
wf = OBSLocal.StagingWorkflow() wf = OBSLocal.FactoryWorkflow()
fc = FreezeCommand(wf.api) fc = FreezeCommand(wf.api)

View File

@ -119,7 +119,7 @@ class TestOBSLock(unittest.TestCase):
self.assertEqual(reason_sub, None, 'does not inherit hold') self.assertEqual(reason_sub, None, 'does not inherit hold')
def setup_vcr(self): def setup_vcr(self):
wf = OBSLocal.StagingWorkflow() wf = OBSLocal.FactoryWorkflow()
wf.create_target() wf.create_target()
# we should most likely create this as part of create_target, but # we should most likely create this as part of create_target, but
# it just slows down all other tests # it just slows down all other tests

View File

@ -28,7 +28,7 @@ class TestOrigin(OBSLocal.TestCase):
super().setUp() super().setUp()
self.target_project = self.randomString('target') self.target_project = self.randomString('target')
self.wf = OBSLocal.StagingWorkflow(self.target_project) self.wf = OBSLocal.FactoryWorkflow(self.target_project)
self.wf.create_attribute_type('OSRT', 'OriginConfig', 1) self.wf.create_attribute_type('OSRT', 'OriginConfig', 1)

View File

@ -11,7 +11,7 @@ class TestRepository(unittest.TestCase):
def setUp(self): def setUp(self):
super(TestRepository, self).setUp() super(TestRepository, self).setUp()
self.wf = OBSLocal.StagingWorkflow() self.wf = OBSLocal.FactoryWorkflow()
def tearDown(self): def tearDown(self):
del self.wf del self.wf

View File

@ -25,7 +25,7 @@ class TestSelect(OBSLocal.TestCase):
def setUp(self): def setUp(self):
super().setUp() super().setUp()
super(TestSelect, self).setUp() super(TestSelect, self).setUp()
self.wf = OBSLocal.StagingWorkflow() self.wf = OBSLocal.FactoryWorkflow()
def tearDown(self): def tearDown(self):
super(TestSelect, self).tearDown() super(TestSelect, self).tearDown()

View File

@ -7,7 +7,7 @@ from . import OBSLocal
class TestUnselect(OBSLocal.TestCase): class TestUnselect(OBSLocal.TestCase):
def test_cleanup_filter(self): def test_cleanup_filter(self):
wf = OBSLocal.StagingWorkflow() wf = OBSLocal.FactoryWorkflow()
UnselectCommand.config_init(wf.api) UnselectCommand.config_init(wf.api)
UnselectCommand.cleanup_days = 1 UnselectCommand.cleanup_days = 1
obsolete = wf.api.project_status_requests('obsolete', UnselectCommand.filter_obsolete) obsolete = wf.api.project_status_requests('obsolete', UnselectCommand.filter_obsolete)