[Python] I want to run use a Official Python Image in my docker which should perform 2...

Discussão em 'Python' iniciado por Stack, Abril 21, 2025.

  1. Stack

    Stack Membro Participativo

    2025-04-20 20:00:23 test-runner-1 | ============================= test session starts ============================== 2025-04-20 20:00:23 test-runner-1 | platform linux -- Python 3.9.22, pytest-8.3.5, pluggy-1.5.0 2025-04-20 20:00:23 test-runner-1 | rootdir: /app 2025-04-20 20:00:23 test-runner-1 | collected 1 item 2025-04-20 20:00:23 test-runner-1 | 2025-04-20 20:00:25 test-runner-1 | tests/test_docker_operations.py Local TDM exists: True 2025-04-20 20:00:25 test-runner-1 | STDOUT: 2025-04-20 20:00:25 test-runner-1 |
    2025-04-20 20:00:25 test-runner-1 | STDERR: 2025-04-20 20:00:25 test-runner-1 |
    2025-04-20 20:00:25 test-runner-1 | F 2025-04-20 20:00:25 test-runner-1 | 2025-04-20 20:00:25 test-runner-1 | =================================== FAILURES =================================== 2025-04-20 20:00:25 test-runner-1 | _______________________ test_tdm_processing_with_command _______________________ 2025-04-20 20:00:25 test-runner-1 | 2025-04-20 20:00:25 test-runner-1 | def test_tdm_processing_with_command(): 2025-04-20 20:00:25 test-runner-1 | # Define paths 2025-04-20 20:00:25 test-runner-1 | input_file = "/app/tests/data/THA3.tdm" 2025-04-20 20:00:25 test-runner-1 | output_dir = "/app/tests/data/GID_362040" 2025-04-20 20:00:25 test-runner-1 |
    2025-04-20 20:00:25 test-runner-1 | print("Local TDM exists:", os.path.exists(f"{os.getcwd()}/tests/data/THA3.tdm")) 2025-04-20 20:00:25 test-runner-1 | # Ensure output dir exists 2025-04-20 20:00:25 test-runner-1 | os.makedirs(output_dir, exist_ok=True) 2025-04-20 20:00:25 test-runner-1 |
    2025-04-20 20:00:25 test-runner-1 | # Construct docker run command 2025-04-20 20:00:25 test-runner-1 | command = [ 2025-04-20 20:00:25 test-runner-1 | "docker", "run", 2025-04-20 20:00:25 test-runner-1 | "-v", f"{os.getcwd()}/tests/data:/input", 2025-04-20 20:00:25 test-runner-1 | "-v", f"{os.getcwd()}/tests/data/GID_362040:/output", 2025-04-20 20:00:25 test-runner-1 | "artifactory.osep.stryker.com/dre-capps-docker-rel/strykercorp/dre/blueprint-studio/app/treatment-plan-generator:1.0.2", 2025-04-20 20:00:25 test-runner-1 | "--encryption-key", "alsfjLiHIH392374*(^$#", 2025-04-20 20:00:25 test-runner-1 | "--tdm-encryption-key", "titok", 2025-04-20 20:00:25 test-runner-1 | "/input/THA3.tdm", 2025-04-20 20:00:25 test-runner-1 | "/output" 2025-04-20 20:00:25 test-runner-1 | ] 2025-04-20 20:00:25 test-runner-1 |
    2025-04-20 20:00:25 test-runner-1 | # Run the command 2025-04-20 20:00:25 test-runner-1 | result = subprocess.run(command, capture_output=True, text=True) 2025-04-20 20:00:25 test-runner-1 |
    2025-04-20 20:00:25 test-runner-1 | # Assert and print for debug 2025-04-20 20:00:25 test-runner-1 | if result.returncode != 0: 2025-04-20 20:00:25 test-runner-1 | print("STDOUT:\n", result.stdout) 2025-04-20 20:00:25 test-runner-1 | print("STDERR:\n", result.stderr) 2025-04-20 20:00:25 test-runner-1 |
    2025-04-20 20:00:25 test-runner-1 |
    2025-04-20 20:00:25 test-runner-1 | > assert result.returncode == 0, f"Docker command failed with return code {result.returncode}:\n{result.stderr}" 2025-04-20 20:00:25 test-runner-1 | E AssertionError: Docker command failed with return code 139: 2025-04-20 20:00:25 test-runner-1 | E
    2025-04-20 20:00:25 test-runner-1 | E assert 139 == 0 2025-04-20 20:00:25 test-runner-1 | E + where 139 = CompletedProcess(args=['docker', 'run', '-v', '/app/tests/data:/input', '-v', '/app/tests/data/GID_362040:/output', 'a...iHIH392374*(^$#', '--tdm-encryption-key', 'titok', '/input/THA3.tdm', '/output'], returncode=139, stdout='', stderr='').returncode 2025-04-20 20:00:25 test-runner-1 | 2025-04-20 20:00:25 test-runner-1 | tests/test_docker_operations.py:95: AssertionError 2025-04-20 20:00:25 test-runner-1 | =========================== short test summary info ============================ 2025-04-20 20:00:25 test-runner-1 | FAILED tests/test_docker_operations.py::test_tdm_processing_with_command - As... 2025-04-20 20:00:25 test-runner-1 | ============================== 1 failed in 1.97s ===============================

    Continue reading...

Compartilhe esta Página