From fbba3f70b9158e883532f34c57285747eb949824 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 b059d8e..33f4c07 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 @@ -56,6 +56,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: @@ -139,7 +143,7 @@ def my_asset( "--job-name", context.dagster_run.job_name, "--test-name", - request.node.name, + _get_current_test_name(request), ] if isinstance(context_injector, PipesS3ContextInjector): @@ -201,7 +205,7 @@ def my_asset( "--extras", metadata_path, "--test-name", - request.node.name, + _get_current_test_name(request), ] invocation_result = pipes_subprocess_client.run( @@ -256,7 +260,7 @@ def my_asset( ): args = self.BASE_ARGS + [ "--test-name", - request.node.name, + _get_current_test_name(request), ] invocation_result = pipes_subprocess_client.run( @@ -321,7 +325,7 @@ def my_asset( ): args = self.BASE_ARGS + [ "--test-name", - request.node.name, + _get_current_test_name(request), ] invocation_result = pipes_subprocess_client.run( @@ -394,7 +398,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( @@ -468,7 +472,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( @@ -561,7 +565,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(