From f3940cd29dd0d2eea9bc83c556a18c025f088941 Mon Sep 17 00:00:00 2001 From: danielgafni Date: Wed, 25 Dec 2024 16:50:53 +0100 Subject: [PATCH] fix --test-name --- .../src/dagster_pipes_tests/suite.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/libraries/pipes/tests/dagster-pipes-tests/src/dagster_pipes_tests/suite.py b/libraries/pipes/tests/dagster-pipes-tests/src/dagster_pipes_tests/suite.py index 12331f7..3bd420c 100644 --- a/libraries/pipes/tests/dagster-pipes-tests/src/dagster_pipes_tests/suite.py +++ b/libraries/pipes/tests/dagster-pipes-tests/src/dagster_pipes_tests/suite.py @@ -57,6 +57,10 @@ METADATA = json.loads(METADATA_PATH.read_text()) + +def _get_current_test_name(request): + return request.node.name.split("[")[0] + def _resolve_metadata_value( value: Any, metadata_type: PipesMetadataType ) -> MetadataValue: @@ -140,7 +144,7 @@ def my_asset( "--job-name", context.run.job_name, "--test-name", - request.node.name, + _get_current_test_name(request), ] if isinstance(context_injector, PipesS3ContextInjector): @@ -202,7 +206,7 @@ def my_asset( "--extras", metadata_path, "--test-name", - request.node.name, + _get_current_test_name(request), ] invocation_result = pipes_subprocess_client.run( @@ -257,7 +261,7 @@ def my_asset( ): args = self.BASE_ARGS + [ "--test-name", - request.node.name, + _get_current_test_name(request), ] invocation_result = pipes_subprocess_client.run( @@ -322,7 +326,7 @@ def my_asset( ): args = self.BASE_ARGS + [ "--test-name", - request.node.name, + _get_current_test_name(request), ] invocation_result = pipes_subprocess_client.run( @@ -395,7 +399,7 @@ def my_asset( "--custom-payload", str(custom_payload_path), "--test-name", - request.node.name, + _get_current_test_name(request), ] invocation_result = pipes_subprocess_client.run( @@ -469,7 +473,7 @@ def my_asset( "--report-asset-materialization", str(asset_materialization_path), "--test-name", - request.node.name, + _get_current_test_name(request), ] invocation_result = pipes_subprocess_client.run( @@ -562,7 +566,7 @@ def my_asset( "--report-asset-check", str(report_asset_check_path), "--test-name", - request.node.name, + _get_current_test_name(request), ] invocation_result = pipes_subprocess_client.run(