3333
3434import pytest
3535
36- from buildstream .testing import create_repo , ALL_REPO_KINDS
36+ from buildstream .testing import create_repo
3737from buildstream .testing import cli # pylint: disable=unused-import
3838from buildstream import _yaml
3939from buildstream .exceptions import ErrorDomain , LoadErrorReason
4040from buildstream ._workspaces import BST_WORKSPACE_FORMAT_VERSION
4141
4242from tests .testutils import create_artifact_share , create_element_size , wait_for_cache_granularity
4343
44- repo_kinds = ALL_REPO_KINDS
4544
4645# Project directory
4746DATA_DIR = os .path .join (os .path .dirname (os .path .realpath (__file__ )), "project" ,)
@@ -170,10 +169,13 @@ def open_workspace(
170169@pytest .mark .datafiles (DATA_DIR )
171170def test_open_multi (cli , tmpdir , datafiles ):
172171 workspace_object = WorkspaceCreator (cli , tmpdir , datafiles )
173- workspaces = workspace_object .open_workspaces (repo_kinds )
172+ kinds = ["tar" ] * 2
173+ suffixs = range (2 )
174174
175- for (elname , workspace ), kind in zip (workspaces , repo_kinds ):
176- assert kind in elname
175+ workspaces = workspace_object .open_workspaces (kinds , suffixs )
176+
177+ for (elname , workspace ), kind , suffix in zip (workspaces , kinds , suffixs ):
178+ assert "{}{}" .format (kind , suffix ) in elname
177179 workspace_lsdir = os .listdir (workspace )
178180 assert elname in workspace_lsdir
179181
@@ -182,8 +184,10 @@ def test_open_multi(cli, tmpdir, datafiles):
182184@pytest .mark .datafiles (DATA_DIR )
183185def test_open_multi_unwritable (cli , tmpdir , datafiles ):
184186 workspace_object = WorkspaceCreator (cli , tmpdir , datafiles )
187+ kinds = ["tar" ] * 2
188+ suffixs = range (2 )
185189
186- element_tuples = workspace_object .create_workspace_elements (repo_kinds , repo_kinds )
190+ element_tuples = workspace_object .create_workspace_elements (kinds , suffixs )
187191 os .makedirs (workspace_object .workspace_cmd , exist_ok = True )
188192
189193 # Now open the workspace, this should have the effect of automatically
@@ -209,8 +213,10 @@ def test_open_multi_unwritable(cli, tmpdir, datafiles):
209213@pytest .mark .datafiles (DATA_DIR )
210214def test_open_multi_with_directory (cli , tmpdir , datafiles ):
211215 workspace_object = WorkspaceCreator (cli , tmpdir , datafiles )
216+ kinds = ["tar" ] * 2
217+ suffixs = range (2 )
212218
213- element_tuples = workspace_object .create_workspace_elements (repo_kinds , repo_kinds )
219+ element_tuples = workspace_object .create_workspace_elements (kinds , suffixs )
214220 os .makedirs (workspace_object .workspace_cmd , exist_ok = True )
215221
216222 # Now open the workspace, this should have the effect of automatically
@@ -636,16 +642,15 @@ def test_list(cli, tmpdir, datafiles):
636642
637643
638644@pytest .mark .datafiles (DATA_DIR )
639- @pytest .mark .parametrize ("kind" , repo_kinds )
640645@pytest .mark .parametrize ("strict" , [("strict" ), ("non-strict" )])
641646@pytest .mark .parametrize (
642647 "from_workspace,guess_element" ,
643648 [(False , False ), (True , True ), (True , False )],
644649 ids = ["project-no-guess" , "workspace-guess" , "workspace-no-guess" ],
645650)
646- def test_build (cli , tmpdir_factory , datafiles , kind , strict , from_workspace , guess_element ):
651+ def test_build (cli , tmpdir_factory , datafiles , strict , from_workspace , guess_element ):
647652 tmpdir = tmpdir_factory .mktemp (BASE_FILENAME )
648- element_name , project , workspace = open_workspace (cli , tmpdir , datafiles , kind , False )
653+ element_name , project , workspace = open_workspace (cli , tmpdir , datafiles , "tar" , False )
649654 checkout = os .path .join (str (tmpdir ), "checkout" )
650655 args_dir = ["-C" , workspace ] if from_workspace else []
651656 args_elm = [element_name ] if not guess_element else []
0 commit comments