create test run does not populate teststatistics field
2018-07-12 06:55:54.32: root : DEBUG Route template: {project}/_apis/test/{resource}/{runId} 2018-07-12 06:55:54.36: root : DEBUG Api version '4.1' 2018-07-12 06:55:54.38: root : DEBUG POST https://REDACTED/THEPROJECT/_apis/test/Runs 2018-07-12 06:55:54.40: root : DEBUG Request content: {'runStatistics': [{'count': 1, 'state': 'Completed', 'outcome': 'Failed'}], 'isAutomated': True, 'name': 'MyTest'} 2018-07-12 06:55:54.43: msrest.pipeline: DEBUG Configuring request: timeout=100, verify=True, cert=None 2018-07-12 06:55:54.45: msrest.pipeline: DEBUG Configuring proxies: '' 2018-07-12 06:55:54.46: msrest.pipeline: DEBUG Evaluate proxies against ENV settings: True 2018-07-12 06:55:54.49: msrest.pipeline: DEBUG Configuring redirects: allow=True, max=30 2018-07-12 06:55:54.49: msrest.pipeline: DEBUG Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90 2018-07-12 06:55:54.59: urllib3.connectionpool: DEBUG Starting new HTTPS connection (1): REDACTED 2018-07-12 06:55:54.361: urllib3.connectionpool: DEBUG https://REDACTED:443 "POST /THEPROJECT/_apis/test/Runs HTTP/1.1" 200 443 2018-07-12 06:55:54.378: root : DEBUG Response content: {"id":74094,"name":"MyTest","url":"https://REDACTED/THEPROJECT/_apis/test/Runs/74094","isAutomated":true,"iteration":"THEPROJECT","owner":{"displayName":null,"id":"00000000-0000-0000-0000-000000000000"},"project":{"id":"493b23e6-f63f-4c56-9c2a-4d09eec371e8","name":"THEPROJECT"},"state":"Unspecified","totalTests":0,"incompleteTests":0,"notApplicableTests":0,"passedTests":0,"unanalyzedTests":0,"revision":2,"webAccessUrl":"https://REDACTED/THEPROJECT/_TestManagement/Runs#runId=74094&_a=runCharts"} {'comment': None, 'substate': None, 'release_environment_uri': None, 'last_updated_date': None, 'owner': <vsts.test.v4_1.models.identity_ref.IdentityRef object at 0x0516C110>, 'unanalyzed_tests': 0, 'post_process_state': None, 'id': 74094, 'custom_fields': None, 'project': <vsts.test.v4_1.models.shallow_reference.ShallowReference object at 0x0516C310>, 'passed_tests': 0, 'is_automated': True, 'build_configuration': None, 'state': u'Unspecified', 'total_tests': 0, 'additional_properties': {}, 'build': None, 'dtl_environment_creation_details': None, 'due_date': None, 'release_uri': None, 'completed_date': None, 'test_environment': None, 'incomplete_tests': 0, 'last_updated_by': None, 'plan': None, 'phase': None, 'started_date': None, 'run_statistics': None, 'test_message_log_id': None, 'name': u'MyTest', 'drop_location': None, 'dtl_environment': None, 'dtl_aut_environment': None, 'url': u'https://REDACTED/THEPROJECT/_apis/test/Runs/74094', 'test_settings': None, 'error_message': None, 'iteration': u'THEPROJECT', 'controller': None, 'web_access_url': u'https://REDACTED/THEPROJECT/_TestManagement/Runs#runId=74094&_a=runCharts', 'filter': None, 'not_applicable_tests': 0, 'created_date': None, 'release': None, 'revision': 2}
Was using the API to create a test run with minimal information (name field, is_automated, and the run_statistics), it appears the test run is being created but on the rest for the particular runid the runStatistics field is [] empty.
One thing I did note on the vsts api page is there is no 4.1 documentation for test cases. Message The requested page is not available for VSTS REST API 4.1. You have been redirected to the newest product version this page is available for.
There is now a 5.0 which does list these api calls as available? Is that perhaps the issue? Or is there more information I need to provide to creating the test run?
My goal is to have a tool generate the test runs and results because the test management framework doesn't appear to allow arbitrary scripts to be considered 'automation' so I am wanting to populate the results myself after series of scripts run...
Found was using wrong api calls, think I got it figured out now...