Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.cosmotech.api.home.dataset.DatasetConstants.DATASET_PART_NAME
import com.cosmotech.api.home.dataset.DatasetConstants.TEST_FILE_NAME
import com.cosmotech.api.home.organization.OrganizationConstants.ORGANIZATION_NAME
import com.cosmotech.api.home.runner.RunnerConstants.RUNNER_NAME
import com.cosmotech.api.home.runner.RunnerConstants.RUNNER_OWNER_NAME
import com.cosmotech.api.home.solution.SolutionConstants.SOLUTION_KEY
import com.cosmotech.api.home.solution.SolutionConstants.SOLUTION_NAME
import com.cosmotech.api.home.solution.SolutionConstants.SOLUTION_REPOSITORY
Expand Down Expand Up @@ -170,7 +169,7 @@ class ControllerTestUtils {
runTemplateName: String? = null,
security: RunnerSecurity? = null,
runSizing: RunnerResourceSizing? = null,
ownerName: String = RUNNER_OWNER_NAME,
additionalData: MutableMap<String, Any>? = null,
description: String = "",
tags: MutableList<String> = mutableListOf(),
datasetList: MutableList<String>? = mutableListOf(),
Expand All @@ -181,7 +180,7 @@ class ControllerTestUtils {
name = name,
solutionId = solutionId,
runTemplateId = runTemplateId,
ownerName = ownerName,
additionalData = additionalData,
description = description,
tags = tags,
datasetList = datasetList,
Expand All @@ -200,7 +199,7 @@ class ControllerTestUtils {
solutionName: String? = null,
runTemplateName: String? = null,
runSizing: RunnerResourceSizing? = null,
ownerName: String = RUNNER_OWNER_NAME,
additionalData: MutableMap<String, Any>? = null,
description: String = "",
tags: MutableList<String> = mutableListOf(),
datasetList: MutableList<String>? = mutableListOf(),
Expand All @@ -215,7 +214,7 @@ class ControllerTestUtils {
datasetList = datasetList,
runSizing = runSizing,
parametersValues = parametersValues,
ownerName = ownerName,
additionalData = additionalData,
solutionName = solutionName,
runTemplateName = runTemplateName)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ package com.cosmotech.api.home.runner
object RunnerConstants {

const val RUNNER_NAME = "my_runner_name"
const val RUNNER_OWNER_NAME = "John Doe"
const val RUNNER_RUN_TEMPLATE = "runtemplate1"
const val NEW_USER_ID = "[email protected]"
const val NEW_USER_ROLE = "editor"
const val NEW_RUNNER_NAME = "my_new_runner_name"

object RequestContent {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.cosmotech.api.home.organization.OrganizationConstants
import com.cosmotech.api.home.runner.RunnerConstants.NEW_USER_ID
import com.cosmotech.api.home.runner.RunnerConstants.NEW_USER_ROLE
import com.cosmotech.api.home.runner.RunnerConstants.RUNNER_NAME
import com.cosmotech.api.home.runner.RunnerConstants.RUNNER_OWNER_NAME
import com.cosmotech.api.home.runner.RunnerConstants.RUNNER_RUN_TEMPLATE
import com.cosmotech.common.events.CsmEventPublisher
import com.cosmotech.common.events.RunStart
Expand Down Expand Up @@ -170,6 +169,9 @@ class RunnerControllerTests : ControllerTestBase() {
val tags = mutableListOf("tags1", "tags2")
val datasetList = mutableListOf(datasetId)
val runnerParameterValue = "parameter_value"
val additionalData =
mutableMapOf(
"you_can_put" to "whatever_you_want_here", "even" to mapOf("object" to "if_you_want"))

val parentId =
createRunnerAndReturnId(
Expand Down Expand Up @@ -203,7 +205,7 @@ class RunnerControllerTests : ControllerTestBase() {
cpu = "cpu_limits",
memory = "memory_limits",
)),
ownerName = RUNNER_OWNER_NAME,
additionalData = additionalData,
description = description,
tags = tags,
datasetList = datasetList,
Expand All @@ -225,7 +227,7 @@ class RunnerControllerTests : ControllerTestBase() {
.andExpect(jsonPath("$.name").value(RUNNER_NAME))
.andExpect(jsonPath("$.createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$.updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$.ownerName").value(RUNNER_OWNER_NAME))
.andExpect(jsonPath("$.additionalData").value(additionalData))
.andExpect(jsonPath("$.description").value(description))
.andExpect(jsonPath("$.parentId").value(parentId))
.andExpect(jsonPath("$.solutionName").value(solutionName))
Expand Down Expand Up @@ -260,6 +262,10 @@ class RunnerControllerTests : ControllerTestBase() {
val runnerParameterValue = "parameter_value"
val runnerParameterVarType = "this_is_a_vartype"

val additionalData =
mutableMapOf(
"you_can_put" to "whatever_you_want_here", "even" to mapOf("object" to "if_you_want"))

val parentId =
createRunnerAndReturnId(
mvc,
Expand Down Expand Up @@ -297,7 +303,7 @@ class RunnerControllerTests : ControllerTestBase() {
cpu = "cpu_limits",
memory = "memory_limits",
)),
ownerName = RUNNER_OWNER_NAME,
additionalData = additionalData,
description = description,
tags = tags,
datasetList = datasetList,
Expand All @@ -318,7 +324,7 @@ class RunnerControllerTests : ControllerTestBase() {
.andExpect(jsonPath("$.name").value(RUNNER_NAME))
.andExpect(jsonPath("$.createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$.updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$.ownerName").value(RUNNER_OWNER_NAME))
.andExpect(jsonPath("$.additionalData").value(additionalData))
.andExpect(jsonPath("$.description").value(description))
.andExpect(jsonPath("$.parentId").value(parentId))
.andExpect(jsonPath("$.solutionName").value(solutionName))
Expand Down Expand Up @@ -357,6 +363,11 @@ class RunnerControllerTests : ControllerTestBase() {
val runnerParameterValue = "parameter_value"
val runnerParameterVarType = "this_is_a_vartype"

val additionalData =
mutableMapOf(
"you_can_put_also" to "whatever_you_want_here",
"even" to mapOf("object" to "if_you_want_too"))

val baseRunnerId =
createRunnerAndReturnId(
mvc,
Expand All @@ -382,7 +393,7 @@ class RunnerControllerTests : ControllerTestBase() {
cpu = "cpu_limits",
memory = "memory_limits",
)),
ownerName = RUNNER_OWNER_NAME,
additionalData = additionalData,
description = description,
tags = tags,
datasetList = datasetList,
Expand All @@ -405,7 +416,7 @@ class RunnerControllerTests : ControllerTestBase() {
.andExpect(jsonPath("$.name").value(RUNNER_NAME))
.andExpect(jsonPath("$.createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$.updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$.ownerName").value(RUNNER_OWNER_NAME))
.andExpect(jsonPath("$.additionalData").value(additionalData))
.andExpect(jsonPath("$.description").value(description))
.andExpect(jsonPath("$.parentId").value(null))
.andExpect(jsonPath("$.solutionName").value(solutionName))
Expand Down Expand Up @@ -434,7 +445,6 @@ class RunnerControllerTests : ControllerTestBase() {
fun list_runners() {

val firstRunnerName = "my_first_runner"
val firstOwnerName = "firstRunnerOwner"
val firstRunnerId =
createRunnerAndReturnId(
mvc,
Expand All @@ -443,11 +453,9 @@ class RunnerControllerTests : ControllerTestBase() {
constructRunnerObject(
name = firstRunnerName,
solutionId = solutionId,
runTemplateId = RUNNER_RUN_TEMPLATE,
ownerName = firstOwnerName))
runTemplateId = RUNNER_RUN_TEMPLATE))

val secondRunnerName = "my_second_runner"
val secondOwnerName = "secondRunnerOwner"
val secondRunnerId =
createRunnerAndReturnId(
mvc,
Expand All @@ -456,8 +464,7 @@ class RunnerControllerTests : ControllerTestBase() {
constructRunnerObject(
name = secondRunnerName,
solutionId = solutionId,
runTemplateId = RUNNER_RUN_TEMPLATE,
ownerName = secondOwnerName))
runTemplateId = RUNNER_RUN_TEMPLATE))

mvc.perform(
get("/organizations/$organizationId/workspaces/$workspaceId/runners")
Expand All @@ -468,7 +475,6 @@ class RunnerControllerTests : ControllerTestBase() {
.andExpect(jsonPath("$[0].name").value(firstRunnerName))
.andExpect(jsonPath("$[0].createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$[0].updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$[0].ownerName").value(firstOwnerName))
.andExpect(jsonPath("$[0].parentId").value(null))
.andExpect(jsonPath("$[0].security.default").value(ROLE_NONE))
.andExpect(jsonPath("$[0].security.accessControlList[0].role").value(ROLE_ADMIN))
Expand All @@ -477,7 +483,6 @@ class RunnerControllerTests : ControllerTestBase() {
.andExpect(jsonPath("$[1].name").value(secondRunnerName))
.andExpect(jsonPath("$[1].createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$[1].updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$[1].ownerName").value(secondOwnerName))
.andExpect(jsonPath("$[1].parentId").value(null))
.andExpect(jsonPath("$[1].security.default").value(ROLE_NONE))
.andExpect(jsonPath("$[1].security.accessControlList[0].role").value(ROLE_ADMIN))
Expand Down
2 changes: 1 addition & 1 deletion doc/Models/Runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
| **runTemplateId** | **String** | the Solution Run Template Id associated with this Runner | [default to null] |
| **organizationId** | **String** | the associated Organization Id | [default to null] |
| **workspaceId** | **String** | the associated Workspace Id | [default to null] |
| **ownerName** | **String** | the name of the owner | [default to null] |
| **solutionName** | **String** | the Solution name | [optional] [default to null] |
| **runTemplateName** | **String** | the Solution Run Template name associated with this Runner | [optional] [default to null] |
| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] |
| **datasets** | [**RunnerDatasets**](RunnerDatasets.md) | | [default to null] |
| **runSizing** | [**RunnerResourceSizing**](RunnerResourceSizing.md) | | [optional] [default to null] |
| **parametersValues** | [**List**](RunnerRunTemplateParameterValue.md) | the list of Solution Run Template parameters values | [default to null] |
Expand Down
2 changes: 1 addition & 1 deletion doc/Models/RunnerCreateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| **datasetList** | **List** | the list of Dataset Id associated to this Runner Run Template | [optional] [default to []] |
| **runSizing** | [**RunnerResourceSizing**](RunnerResourceSizing.md) | | [optional] [default to null] |
| **parametersValues** | [**List**](RunnerRunTemplateParameterValue.md) | the list of Solution Run Template parameters values | [optional] [default to []] |
| **ownerName** | **String** | the name of the owner | [default to null] |
| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] |
| **solutionName** | **String** | the Solution name | [optional] [default to null] |
| **runTemplateName** | **String** | the Solution Run Template name associated with this Runner | [optional] [default to null] |
| **security** | [**RunnerSecurity**](RunnerSecurity.md) | | [optional] [default to null] |
Expand Down
2 changes: 1 addition & 1 deletion doc/Models/RunnerUpdateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| **datasetList** | **List** | the list of Dataset Id associated to this Runner Run Template | [optional] [default to null] |
| **runSizing** | [**RunnerResourceSizing**](RunnerResourceSizing.md) | | [optional] [default to null] |
| **parametersValues** | [**List**](RunnerRunTemplateParameterValue.md) | the list of Solution Run Template parameters values | [optional] [default to null] |
| **ownerName** | **String** | the name of the owner | [optional] [default to null] |
| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] |
| **solutionName** | **String** | the Solution name | [optional] [default to null] |
| **runTemplateName** | **String** | the Solution Run Template name associated with this Runner | [optional] [default to null] |

Expand Down
6 changes: 3 additions & 3 deletions openapi/plantuml/schemas.plantuml
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ entity Runner {
* runTemplateId: String
* organizationId: String
* workspaceId: String
* ownerName: String
solutionName: String
runTemplateName: String
additionalData: Map
* datasets: RunnerDatasets
runSizing: RunnerResourceSizing
* parametersValues: List<RunnerRunTemplateParameterValue>
Expand All @@ -403,7 +403,7 @@ entity RunnerCreateRequest {
datasetList: List<String>
runSizing: RunnerResourceSizing
parametersValues: List<RunnerRunTemplateParameterValue>
* ownerName: String
additionalData: Map
solutionName: String
runTemplateName: String
security: RunnerSecurity
Expand Down Expand Up @@ -449,7 +449,7 @@ entity RunnerUpdateRequest {
datasetList: List<String>
runSizing: RunnerResourceSizing
parametersValues: List<RunnerRunTemplateParameterValue>
ownerName: String
additionalData: Map
solutionName: String
runTemplateName: String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ class RunServiceIntegrationTest : CsmTestBase() {
solutionId = solutionId,
runTemplateId = runTemplateId,
datasetList = datasetList,
ownerName = "owner",
security =
RunnerSecurity(
ROLE_NONE, mutableListOf(RunnerAccessControl(CONNECTED_ADMIN_USER, ROLE_ADMIN))))
Expand All @@ -243,7 +242,6 @@ class RunServiceIntegrationTest : CsmTestBase() {
RunnerEditInfo(
timestamp = Instant.now().toEpochMilli(),
userId = getCurrentAccountIdentifier(csmPlatformProperties)),
ownerName = "owner",
datasets = RunnerDatasets(bases = mutableListOf(), parameter = ""),
workspaceId = workspaceId,
validationStatus = RunnerValidationStatus.Draft,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ class ContainerFactoryTests {
workspaceId = "workspace",
createInfo = RunnerEditInfo(timestamp = Instant.now().toEpochMilli(), userId = "user"),
updateInfo = RunnerEditInfo(timestamp = Instant.now().toEpochMilli(), userId = "user"),
ownerName = "owner",
parametersValues =
mutableListOf(
RunnerRunTemplateParameterValue(parameterId = "param1", value = "value1"),
Expand Down
Loading