From 07bc6a37c4f0de5504556e22940f19737564af72 Mon Sep 17 00:00:00 2001 From: Pauline Ribeyre <4224001+paulineribeyre@users.noreply.github.com> Date: Fri, 17 Apr 2026 15:33:05 -0500 Subject: [PATCH 1/2] gen3 run: propagate exit code --- gen3/tools/wrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen3/tools/wrap.py b/gen3/tools/wrap.py index 463afd04..90aa18a5 100644 --- a/gen3/tools/wrap.py +++ b/gen3/tools/wrap.py @@ -30,7 +30,7 @@ def run_command(self): f"Running the command {self.command_args} with gen3 access token in environment variable" ) try: - subprocess.run(cmd, stderr=subprocess.STDOUT) + subprocess.run(cmd, stderr=subprocess.STDOUT, check=True) except Exception as e: logger.error(f"ERROR while running '{cmd}':", e) raise From 286f19cfd5162f24f7cb2f3caf35afb195917e7d Mon Sep 17 00:00:00 2001 From: Pauline Ribeyre <4224001+paulineribeyre@users.noreply.github.com> Date: Fri, 17 Apr 2026 15:39:56 -0500 Subject: [PATCH 2/2] fix test --- tests/test_wrap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_wrap.py b/tests/test_wrap.py index a140459c..e21f4d6e 100644 --- a/tests/test_wrap.py +++ b/tests/test_wrap.py @@ -14,7 +14,9 @@ def test_gen3_wrap_valid_auth(mock_gen3_auth): with patch("gen3.tools.wrap.subprocess.run") as mock_subprocess_run: wrapper_obj = Gen3Wrap(mock_gen3_auth, test_command_args) wrapper_obj.run_command() - mock_subprocess_run.assert_called_once_with(list(test_command_args), stderr=-2) + mock_subprocess_run.assert_called_once_with( + list(test_command_args), stderr=-2, check=True + ) @patch.object(Gen3Auth, "get_access_token", MagicMock(side_effect=Gen3AuthError()))