Skip to content

Commit 6f73245

Browse files
committed
Add ugly fix on run /start cause swagger does not handle simple string w/o double quotes (not json valid)
1 parent d624d6c commit 6f73245

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

runner/src/integrationTest/kotlin/com/cosmotech/runner/service/RunnerServiceIntegrationTest.kt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import com.cosmotech.solution.domain.Solution
4646
import com.cosmotech.solution.domain.SolutionAccessControl
4747
import com.cosmotech.solution.domain.SolutionSecurity
4848
import com.cosmotech.workspace.api.WorkspaceApiService
49-
import com.cosmotech.workspace.azure.WorkspaceEventHubInfo
5049
import com.cosmotech.workspace.domain.Workspace
5150
import com.cosmotech.workspace.domain.WorkspaceAccessControl
5251
import com.cosmotech.workspace.domain.WorkspaceSecurity
@@ -590,7 +589,7 @@ class RunnerServiceIntegrationTest : CsmRedisTestBase() {
590589

591590
val runId =
592591
runnerApiService.startRun(organizationSaved.id!!, workspaceSaved.id!!, runnerSaved.id!!)
593-
assertEquals(expectedRunId, runId)
592+
assertEquals("\"" + expectedRunId + "\"", runId)
594593

595594
val lastRunId =
596595
runnerApiService
@@ -599,19 +598,6 @@ class RunnerServiceIntegrationTest : CsmRedisTestBase() {
599598
assertEquals(expectedRunId, lastRunId)
600599
}
601600

602-
private fun makeWorkspaceEventHubInfo(eventHubAvailable: Boolean): WorkspaceEventHubInfo {
603-
return WorkspaceEventHubInfo(
604-
eventHubNamespace = "eventHubNamespace",
605-
eventHubAvailable = eventHubAvailable,
606-
eventHubName = "eventHubName",
607-
eventHubUri = "eventHubUri",
608-
eventHubSasKeyName = "eventHubSasKeyName",
609-
eventHubSasKey = "eventHubSasKey",
610-
eventHubCredentialType =
611-
CsmPlatformProperties.CsmPlatformAzure.CsmPlatformAzureEventBus.Authentication.Strategy
612-
.SHARED_ACCESS_POLICY)
613-
}
614-
615601
private fun makeConnector(name: String = "name"): Connector {
616602
return Connector(
617603
key = UUID.randomUUID().toString(),

runner/src/main/kotlin/com/cosmotech/runner/service/RunnerApiServiceImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ internal class RunnerApiServiceImpl(
8585

8686
val runnerInstance = runnerService.getInstance(runnerId).userHasPermission(PERMISSION_LAUNCH)
8787

88-
return runnerService.startRunWith(runnerInstance)
88+
return "\"" + runnerService.startRunWith(runnerInstance) + "\""
8989
}
9090

9191
override fun stopRun(organizationId: String, workspaceId: String, runnerId: String) {

runner/src/main/openapi/runner.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ paths:
215215
content:
216216
application/json:
217217
schema:
218-
type: string
218+
type: string
219219
"404":
220220
description: the Runner specified is unknown or you don't have access to it
221221

@@ -877,7 +877,6 @@ components:
877877
solutionName: Brewery Solution
878878
runTemplateId: "hundred"
879879
runTemplateName: Full simulation 100 steps
880-
state: Running
881880
ownerName: Bob
882881
creationDate: "2021-04-21T17:32:28Z"
883882
lastUpdate: "2021-04-21T17:32:28Z"
@@ -909,7 +908,6 @@ components:
909908
solutionName: Brewery Solution
910909
runTemplateId: "hundred"
911910
runTemplateName: Full simulation 100 steps
912-
state: Created
913911
ownerName: Bob
914912
creationDate: "2021-04-21T17:32:28Z"
915913
lastUpdate: "2021-04-21T17:32:28Z"
@@ -937,7 +935,6 @@ components:
937935
solutionName: Brewery Solution
938936
runTemplateId: "hundred"
939937
runTemplateName: Full simulation 100 steps
940-
state: Running
941938
ownerName: Bob
942939
creationDate: "2021-04-21T17:32:28Z"
943940
lastUpdate: "2021-04-21T17:32:28Z"
@@ -965,7 +962,6 @@ components:
965962
solutionName: Brewery Solution
966963
runTemplateId: "hundred"
967964
runTemplateName: Full simulation 100 steps
968-
state: Failed
969965
ownerName: Alice
970966
creationDate: "2021-04-21T17:32:28Z"
971967
lastUpdate: "2021-04-21T17:32:28Z"
@@ -1003,7 +999,6 @@ components:
1003999
solutionName: Brewery Solution
10041000
runTemplateId: "hundred"
10051001
runTemplateName: Full simulation 100 steps
1006-
state: Created
10071002
ownerName: Bob
10081003
creationDate: "2021-04-21T17:32:28Z"
10091004
lastUpdate: "2021-04-21T17:32:28Z"
@@ -1042,7 +1037,6 @@ components:
10421037
- reference
10431038
ownerId: "1"
10441039
worskspaceId: "1"
1045-
state: Created
10461040
creationDate: "2021-04-21T17:32:28Z"
10471041
lastUpdate: "2021-04-21T17:32:28Z"
10481042
ownerName: Alice
@@ -1069,7 +1063,6 @@ components:
10691063
parentId: "1"
10701064
ownerId: "1"
10711065
worskspaceId: "1"
1072-
state: Running
10731066
creationDate: "2021-04-21T17:32:28Z"
10741067
lastUpdate: "2021-04-21T17:32:28Z"
10751068
ownerName: Alice
@@ -1096,7 +1089,6 @@ components:
10961089
parentId: "1"
10971090
ownerId: "2"
10981091
worskspaceId: "1"
1099-
state: Failed
11001092
creationDate: "2021-04-21T17:32:28Z"
11011093
lastUpdate: "2021-04-21T17:32:28Z"
11021094
ownerName: Alice

0 commit comments

Comments
 (0)