(t *testing.T)
| 128 | } |
| 129 | |
| 130 | func TestRunFailed(t *testing.T) { |
| 131 | exec := process.NewExecCustomProcess(0, "Done", "", func(name string, args []string) { |
| 132 | outputDirectory := test.GetArgumentValue(args, "--output") |
| 133 | writeNupkgArchive(t, filepath.Join(outputDirectory, "MyLibrary_Tests.nupkg")) |
| 134 | }) |
| 135 | context := test.NewContextBuilder(). |
| 136 | WithDefinition("studio", studio.StudioDefinition). |
| 137 | WithCommandPlugin(TestRunCommand{exec}). |
| 138 | WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/Folders?$filter=FullyQualifiedName eq 'Shared'", http.StatusOK, `{"value":[{"Id":938064,"FullyQualifiedName":"Shared"}]}`). |
| 139 | WithUrlResponse("/my-org/my-tenant/orchestrator_/api/PackageFeeds/GetFolderFeed?folderId=938064", http.StatusOK, `null`). |
| 140 | WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/Processes/UiPath.Server.Configuration.OData.UploadPackage", http.StatusOK, `{}`). |
| 141 | WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/Releases?$filter=ProcessKey eq 'MyLibrary'", http.StatusOK, `{"value":[]}`). |
| 142 | WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/Releases", http.StatusCreated, `{"name":"MyLibrary","processKey":"MyLibrary","processVersion":"1.0.195912597"}`). |
| 143 | WithUrlResponse("/my-org/my-tenant/orchestrator_/api/TestAutomation/CreateTestSetForReleaseVersion", http.StatusCreated, "29991"). |
| 144 | WithUrlResponse("/my-org/my-tenant/orchestrator_/api/TestAutomation/StartTestSetExecution?testSetId=29991&triggerType=ExternalTool", http.StatusOK, "349001"). |
| 145 | WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/TestSets(29991)?$expand=TestCases($expand=Definition;$select=Id,Definition,DefinitionId,ReleaseId,VersionNumber),Packages&$select=TestCases,Name", http.StatusOK, |
| 146 | `{ |
| 147 | "TestCases":[{ |
| 148 | "Id":169537, |
| 149 | "Definition":{ |
| 150 | "Name":"MyTestCase", |
| 151 | "PackageIdentifier":"1.1.1" |
| 152 | } |
| 153 | }, |
| 154 | { |
| 155 | "Id":169538, |
| 156 | "Definition":{ |
| 157 | "Name":"MyTestCase2", |
| 158 | "PackageIdentifier":"1.1.1" |
| 159 | } |
| 160 | }], |
| 161 | "Packages":[] |
| 162 | }`). |
| 163 | WithUrlResponse("/my-org/my-tenant/orchestrator_/odata/TestSetExecutions(349001)?$expand=TestCaseExecutions($expand=TestCaseAssertions)", http.StatusOK, |
| 164 | `{ |
| 165 | "Name":"Automated - MyLibrary - 1.0.195912597", |
| 166 | "TestSetId":29991, |
| 167 | "StartTime":"2025-03-17T12:10:09.087Z", |
| 168 | "EndTime":"2025-03-17T12:10:25.058Z", |
| 169 | "Status":"Failed", |
| 170 | "Id":349001, |
| 171 | "TestCaseExecutions":[{ |
| 172 | "Id":704123, |
| 173 | "TestCaseId":169537, |
| 174 | "EntryPointPath":"TestCase.xaml", |
| 175 | "StartTime":"2025-03-17T12:10:09.087Z", |
| 176 | "EndTime":"2025-03-17T12:10:18.083Z", |
| 177 | "Status":"Passed" |
| 178 | },{ |
| 179 | "Id":704124, |
| 180 | "TestCaseId":169538, |
| 181 | "EntryPointPath":"TestCase2.xaml", |
| 182 | "StartTime":"2025-03-17T12:10:21.015Z", |
| 183 | "EndTime":"2025-03-17T12:10:25.058Z", |
| 184 | "Status":"Failed", |
| 185 | "Info": "There was an error" |
| 186 | }] |
| 187 | }`). |
nothing calls this directly
no test coverage detected