Skip to content

Add possibility to select logging level. #9423

Add possibility to select logging level.

Add possibility to select logging level. #9423

GitHub Actions / SDK CLI Test Result [nirovins/change_logging_mechanism](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-test.yml?query=branch:nirovins/change_logging_mechanism++) failed Apr 18, 2024 in 0s

1 fail, 23 skipped, 637 pass in 1h 5m 22s

    4 files  ±  0      4 suites  ±0   1h 5m 22s ⏱️ + 9m 49s
  661 tests + 57    637 ✅ + 56  23 💤 +1  1 ❌ ±0 
2 644 runs  +228  2 551 ✅ +224  92 💤 +4  1 ❌ ±0 

Results for commit 06f8926. ± Comparison against earlier commit b3a77ec.

Annotations

Check warning on line 0 in tests.sdk_cli_test.e2etests.test_cli.TestCli

See this annotation in the file changed.

@github-actions github-actions / SDK CLI Test Result [nirovins/change_logging_mechanism](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-test.yml?query=branch:nirovins/change_logging_mechanism++)

1 out of 4 runs failed: test_flow_run_resume_with_image_aggregation (tests.sdk_cli_test.e2etests.test_cli.TestCli)

artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 17s]
Raw output
AssertionError: assert 11 > 11
 +  where 11 = len([{'line_number': 0, 'output_image': {'data:image/png;path': '8b51ef02-a142-417b-a76e-0538240b362d.png'}}, {'line_number': 1, 'output_image': {'data:image/png;path': '17ea1fa3-d4da-469d-b79c-6b15f030e44d.png'}}, {'line_number': 3, 'output_image': {'data:image/png;path': 'b51ba147-9117-4459-a761-755fe8452e09.png'}}, {'line_number': 4, 'output_image': {'data:image/png;path': '68bf5ec1-eed4-40cf-bb71-a4bfcac0b9d5.png'}}, {'line_number': 5, 'output_image': {'data:image/png;path': '2aea635b-853f-4147-affd-d944bb0dfe23.png'}}, {'line_number': 6, 'output_image': {'data:image/png;path': '02798544-eaa9-4f6a-ba6f-4ccd7b6c7186.png'}}, ...])
 +  and   11 = len([{'line_number': 0, 'output_image': {'data:image/png;path': '325a7426-07ce-48f8-9777-5961706c20a4.png'}}, {'line_number': 1, 'output_image': {'data:image/png;path': 'f4e85bfe-89b8-4c91-a75a-347fa69616ff.png'}}, {'line_number': 3, 'output_image': {'data:image/png;path': 'cd9fd6f3-7cb4-4847-bc9f-3fb877a2ebac.png'}}, {'line_number': 4, 'output_image': {'data:image/png;path': '693c2156-b7c9-4061-a67b-b6e6bd5bf27a.png'}}, {'line_number': 5, 'output_image': {'data:image/png;path': '05afad26-0d42-4580-93a0-de7ed952c250.png'}}, {'line_number': 6, 'output_image': {'data:image/png;path': '24ee2672-9ee3-4e82-8763-25bb98eec5d0.png'}}, ...])
self = <sdk_cli_test.e2etests.test_cli.TestCli object at 0x7f0f54d10b80>
local_client = <promptflow._sdk._pf_client.PFClient object at 0x7f0f57f2db10>

    def test_flow_run_resume_with_image_aggregation(self, local_client) -> None:
        metrics = {}
    
        def test_metric_logger(key, value):
            metrics[key] = value
    
        add_metric_logger(test_metric_logger)
    
        run_id = str(uuid.uuid4())
        # fetch std out
        run_pf_command(
            "run",
            "create",
            "--flow",
            f"{FLOWS_DIR}/eval_flow_with_image_resume_random_fail",
            "--data",
            f"{FLOWS_DIR}/eval_flow_with_image_resume_random_fail/data.jsonl",
            "--column-mapping",
            "input_image='${data.input_image}'",
            "--name",
            run_id,
        )
        original_run = local_client.runs.get(name=run_id)
        assert original_run.status == "Completed"
        output_path = os.path.join(original_run.properties["output_path"], "flow_outputs", "output.jsonl")
        with open(output_path, "r") as file:
            original_output = [json.loads(line) for line in file]
        original_success_count = len(original_output)
        original_image_count = metrics.get("image_count", None)
    
        new_run_id = str(uuid.uuid4())
        display_name = "test"
        description = "new description"
        run_pf_command(
            "run",
            "create",
            "--resume-from",
            run_id,
            "--name",
            new_run_id,
            "--set",
            f"display_name={display_name}",
            f"description={description}",
            "tags.A=A",
            "tags.B=B",
        )
        resume_run = local_client.runs.get(name=new_run_id)
        resume_image_count = metrics.get("image_count", None)
        assert resume_run.name == new_run_id
        assert resume_run.display_name == display_name
        assert resume_run.description == description
        assert resume_run.tags == {"A": "A", "B": "B"}
        assert resume_run._resume_from == run_id
    
        # assert new run resume from the original run
        output_path = os.path.join(resume_run.properties["output_path"], "flow_outputs", "output.jsonl")
        with open(output_path, "r") as file:
            resume_output = [json.loads(line) for line in file]
>       assert len(resume_output) > len(original_output)
E       AssertionError: assert 11 > 11
E        +  where 11 = len([{'line_number': 0, 'output_image': {'data:image/png;path': '8b51ef02-a142-417b-a76e-0538240b362d.png'}}, {'line_number': 1, 'output_image': {'data:image/png;path': '17ea1fa3-d4da-469d-b79c-6b15f030e44d.png'}}, {'line_number': 3, 'output_image': {'data:image/png;path': 'b51ba147-9117-4459-a761-755fe8452e09.png'}}, {'line_number': 4, 'output_image': {'data:image/png;path': '68bf5ec1-eed4-40cf-bb71-a4bfcac0b9d5.png'}}, {'line_number': 5, 'output_image': {'data:image/png;path': '2aea635b-853f-4147-affd-d944bb0dfe23.png'}}, {'line_number': 6, 'output_image': {'data:image/png;path': '02798544-eaa9-4f6a-ba6f-4ccd7b6c7186.png'}}, ...])
E        +  and   11 = len([{'line_number': 0, 'output_image': {'data:image/png;path': '325a7426-07ce-48f8-9777-5961706c20a4.png'}}, {'line_number': 1, 'output_image': {'data:image/png;path': 'f4e85bfe-89b8-4c91-a75a-347fa69616ff.png'}}, {'line_number': 3, 'output_image': {'data:image/png;path': 'cd9fd6f3-7cb4-4847-bc9f-3fb877a2ebac.png'}}, {'line_number': 4, 'output_image': {'data:image/png;path': '693c2156-b7c9-4061-a67b-b6e6bd5bf27a.png'}}, {'line_number': 5, 'output_image': {'data:image/png;path': '05afad26-0d42-4580-93a0-de7ed952c250.png'}}, {'line_number': 6, 'output_image': {'data:image/png;path': '24ee2672-9ee3-4e82-8763-25bb98eec5d0.png'}}, ...])

/home/runner/work/promptflow/promptflow/src/promptflow-devkit/tests/sdk_cli_test/e2etests/test_cli.py:2390: AssertionError