Skip to content

Refine sdk resume test #8252

Refine sdk resume test

Refine sdk resume test #8252

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

1 fail, 17 skipped, 474 pass in 46m 29s

    4 files  ±0      4 suites  ±0   46m 29s ⏱️ -16s
  492 tests  - 1    474 ✅  - 1  17 💤 ±0  1 ❌ ±0 
1 968 runs   - 4  1 896 ✅  - 4  68 💤 ±0  4 ❌ ±0 

Results for commit 7f595dd. ± Comparison against earlier commit fc35352.

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 [shimin/refine_sdk_resume_test](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-test.yml?query=branch:shimin/refine_sdk_resume_test++)

All 4 runs failed: test_flow_run_resume_from_token (tests.sdk_cli_test.e2etests.test_cli.TestCli)

artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results-sdk-cli.xml [took 15s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results-sdk-cli.xml [took 13s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results-sdk-cli.xml [took 13s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results-sdk-cli.xml [took 14s]
Raw output
AttributeError: 'dict' object has no attribute 'system_metrics'
self = <sdk_cli_test.e2etests.test_cli.TestCli object at 0x7f23144ac2b0>
capfd = <_pytest.capture.CaptureFixture object at 0x7f230f5dd510>
local_client = <promptflow._sdk._pf_client.PFClient object at 0x7f23149ba350>

    def test_flow_run_resume_from_token(self, capfd, local_client) -> None:
        run_id = str(uuid.uuid4())
        # fetch std out
        run_pf_command(
            "run",
            "create",
            "--flow",
            f"{FLOWS_DIR}/web_classification_random_fail",
            "--data",
            f"{FLOWS_DIR}/web_classification_random_fail/data.jsonl",
            "--column-mapping",
            "url='${data.url}'",
            "--name",
            run_id,
        )
        out, _ = capfd.readouterr()
        assert "Completed" in out
        original_run = local_client.runs.get(name=run_id)
    
        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)
        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 (
            original_run.properties.system_metrics.total_tokens <= original_run.properties.system_metrics.total_tokens
>       )
E       AttributeError: 'dict' object has no attribute 'system_metrics'

tests/sdk_cli_test/e2etests/test_cli.py:2207: AttributeError