GithubHelp home page GithubHelp logo

Comments (6)

vtbassmatt avatar vtbassmatt commented on September 15, 2024

There's an endpoint for it, so there will be a Python API for it as well.

from azure-devops-python-samples.

pbissert avatar pbissert commented on September 15, 2024

You're right. That didn't exist in the API v4.1, so now we wait.

from azure-devops-python-samples.

tedchamb avatar tedchamb commented on September 15, 2024

@pbissert Is this what you are looking for get_test_result_by_id:

https://github.com/Microsoft/azure-devops-python-api/blob/d16026911f93361becb52d2f1c124d5c3e8a82e7/vsts/vsts/test/v4_1/test_client.py#L1167

The API is there in 4.1, it is just not documented on the site.

from azure-devops-python-samples.

pbissert avatar pbissert commented on September 15, 2024

@tedchamb Thanks for pointing that out. Let me see if I can get it to work.

Really I'm just trying to get the latest outcome for a given test case. It seems like the path to get there is to loop through all run ids (get_test_runs) loop through the test results for an iterations run id, then check the test case.

desired_test_case = 1234
for run in test_client.get_test_runs('Portfolio'):
    for res in test_client.get_test_results('Portfolio', run.id):
        if res.test_case == desired_test_case:
            return res.outcome
return None

Is there a more efficient way?

from azure-devops-python-samples.

BOB-PHL avatar BOB-PHL commented on September 15, 2024

@tedchamb @vtbassmatt

Hello, I had a couple of follow-up questions.
With VSTS v4.1 test_client.py referenced above, I'd like to get the test results (passed, failed, blocked, etc.) for the tests in a test suite.

  1. With the 'get_test_results' method, the test results are returned given you have the run_id. Is there a way to get the run_id's for a given 'test case'/'test case ID'?

  2. And relatedly, the 'get_test_cases' method returns object addresses for 'point_assignments' and for 'test_case'. Is there a way to obtain the object values/contents for 'point_assignments' and for 'test_case'?

Thanks very much, in advance, for any help/guidance.

from azure-devops-python-samples.

vtbassmatt avatar vtbassmatt commented on September 15, 2024

Hi @BOB-PHL. If there's a REST API in the Test area which does what you want, then it works from Python. Unfortunately I don't know enough about the Test APIs to comment.

from azure-devops-python-samples.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.