11
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
- import asyncio
15
14
import dataclasses
16
15
import functools
17
16
import os
@@ -100,10 +99,11 @@ def run(test_case: TestCase) -> Tuple[str, client.client.RunPipelineResult]:
100
99
101
100
102
101
def get_kfp_package_path () -> str :
102
+ repo_name = os .environ .get ('REPO_NAME' , 'kubeflow/pipelines' )
103
103
if os .environ .get ('PULL_NUMBER' ) is not None :
104
- path = f'git+https://github.com/kubeflow/pipelines .git@refs/pull/{ os .environ . get ( "PULL_NUMBER" ) } /merge#subdirectory=sdk/python'
104
+ path = f'git+https://github.com/{ repo_name } .git@refs/pull/{ os .environ [ "PULL_NUMBER" ] } /merge#subdirectory=sdk/python'
105
105
else :
106
- path = 'git+https://github.com/kubeflow/pipelines .git@master#subdirectory=sdk/python'
106
+ path = f 'git+https://github.com/{ repo_name } .git@master#subdirectory=sdk/python'
107
107
print (f'Using the following KFP package path for tests: { path } ' )
108
108
return path
109
109
@@ -112,18 +112,15 @@ def get_kfp_package_path() -> str:
112
112
dsl .component , kfp_package_path = get_kfp_package_path ())
113
113
114
114
115
- @pytest .mark .asyncio_cooperative
116
115
@pytest .mark .parametrize ('test_case' , create_test_case_parameters ())
117
- async def test (test_case : TestCase ) -> None :
118
- """Asynchronously runs all samples and test that they succeed."""
119
- event_loop = asyncio .get_running_loop ()
116
+ def test (test_case : TestCase ) -> None :
120
117
try :
121
118
run_url , run_result = run (test_case )
122
119
except Exception as e :
123
120
raise RuntimeError (
124
121
f'Error triggering pipeline { test_case .name } .' ) from e
125
122
126
- api_run = await event_loop . run_in_executor ( None , wait , run_result )
123
+ api_run = wait ( run_result )
127
124
assert api_run .state == test_case .expected_state , f'Pipeline { test_case .name } ended with incorrect status: { api_run .state } . More info: { run_url } '
128
125
129
126
0 commit comments