MCPcopy Create free account
hub / github.com/UiPath/uipathcli / TestRunParallelPassed

Function TestRunParallelPassed

plugin/studio/testrun/test_run_command_test.go:831–997  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

829}
830
831func TestRunParallelPassed(t *testing.T) {
832 context := test.NewContextBuilder().
833 WithDefinition("studio", studio.StudioDefinition).
834 WithCommandPlugin(NewTestRunCommand()).
835 WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/Folders?$filter=FullyQualifiedName eq 'Shared'", http.StatusOK, `{"value":[{"Id":938064,"FullyQualifiedName":"Shared"}]}`).
836 WithUrlResponse("/my-org/my-tenant/orchestrator_/api/PackageFeeds/GetFolderFeed?folderId=938064", http.StatusOK, `null`).
837 WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/Processes/UiPath.Server.Configuration.OData.UploadPackage", http.StatusOK, `{}`).
838 WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/Releases?$filter=ProcessKey eq 'MyFirstProcess_Tests'", http.StatusOK, `{"value":[{"id":10000,"name":"MyFirstProcess_Tests"}]}`).
839 WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/Releases?$filter=ProcessKey eq 'MySecondProcess_Tests'", http.StatusOK, `{"value":[{"id":20000,"name":"MySecondProcess_Tests"}]}`).
840 WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/Releases(10000)", http.StatusOK, `{"name":"MyFirstProcess_Tests","processKey":"MyFirstProcess_Tests","processVersion":"1.0.0"}`).
841 WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/Releases(20000)", http.StatusOK, `{"name":"MySecondProcess_Tests","processKey":"MySecondProcess_Tests","processVersion":"2.0.0"}`).
842 WithResponseHandler(func(request test.RequestData) test.ResponseData {
843 if request.URL.Path == "/my-org/my-tenant/orchestrator_/api/TestAutomation/CreateTestSetForReleaseVersion" {
844 body := map[string]interface{}{}
845 err := json.Unmarshal(request.Body, &body)
846 if err != nil {
847 return test.ResponseData{Status: http.StatusInternalServerError, Body: err.Error()}
848 }
849 if body["releaseId"] == 10000.0 {
850 return test.ResponseData{Status: http.StatusCreated, Body: "100002"}
851 }
852 return test.ResponseData{Status: http.StatusCreated, Body: "200002"}
853 }
854 return test.ResponseData{Status: http.StatusInternalServerError, Body: "Unhandled HTTP request " + request.URL.Path}
855 }).
856 WithUrlResponse("/my-org/my-tenant/orchestrator_/api/TestAutomation/StartTestSetExecution?testSetId=100002&triggerType=ExternalTool", http.StatusOK, "100001").
857 WithUrlResponse("/my-org/my-tenant/orchestrator_/api/TestAutomation/StartTestSetExecution?testSetId=200002&triggerType=ExternalTool", http.StatusOK, "200001").
858 WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/TestSets(100002)?$expand=TestCases($expand=Definition;$select=Id,Definition,DefinitionId,ReleaseId,VersionNumber),Packages&$select=TestCases,Name", http.StatusOK,
859 `{
860 "TestCases":[{
861 "Id":100004,
862 "Definition":{
863 "Name":"MyTestCase",
864 "PackageIdentifier":"1.1.1"
865 }
866 }],
867 "Packages":[]
868 }`).
869 WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/TestSets(200002)?$expand=TestCases($expand=Definition;$select=Id,Definition,DefinitionId,ReleaseId,VersionNumber),Packages&$select=TestCases,Name", http.StatusOK,
870 `{
871 "TestCases":[{
872 "Id":200004,
873 "Definition":{
874 "Name":"MySecondTestCase",
875 "PackageIdentifier":"2.2.2"
876 }
877 }],
878 "Packages":[]
879 }`).
880 WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/TestSetExecutions(100001)?$expand=TestCaseExecutions($expand=TestCaseAssertions)", http.StatusOK,
881 `{
882 "Name":"Automated - MyFirstProcess_Tests - 1.0.0",
883 "TestSetId":100002,
884 "StartTime":"2025-03-17T12:10:09.053Z",
885 "EndTime":"2025-03-17T12:10:18.183Z",
886 "Status":"Passed",
887 "Id":100001,
888 "TestCaseExecutions":[{

Callers

nothing calls this directly

Calls 12

NewContextBuilderFunction · 0.92
NewCrossPlatformProjectFunction · 0.92
RunCliFunction · 0.92
ParseOutputFunction · 0.92
NewTestRunCommandFunction · 0.85
WithUrlResponseMethod · 0.80
WithResponseHandlerMethod · 0.80
WithCommandPluginMethod · 0.80
WithDefinitionMethod · 0.80
ErrorMethod · 0.80
WithProjectNameMethod · 0.80
BuildMethod · 0.45

Tested by

no test coverage detected