Skip to content

Commit

Permalink
cleanup up db tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marctalbott committed Dec 10, 2024
1 parent 5167fd6 commit d95c38b
Showing 1 changed file with 0 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ class RuntimeServiceDbQueriesSpec extends AnyFlatSpecLike with TestComponent wit
c1 <- IO(
makeCluster(1).saveWithRuntimeConfig(d1RuntimeConfig)
)
c1WorkspaceIds = c1.workspaceId match {
case Some(workspaceId) => Set(WorkspaceResourceSamResourceId(workspaceId))
case None => Set.empty[WorkspaceResourceSamResourceId]
}
list2 <- RuntimeServiceDbQueries
.listRuntimes(runtimeIds = Set(c1.samResource), excludeStatuses = List(RuntimeStatus.Deleted))
.transaction
Expand All @@ -81,9 +77,6 @@ class RuntimeServiceDbQueriesSpec extends AnyFlatSpecLike with TestComponent wit
c2 <- IO(
makeCluster(2).saveWithRuntimeConfig(d2RuntimeConfig)
)
bothWorkspaceIds = Set(c1.workspaceId, c2.workspaceId).collect { case Some(workspaceId) =>
WorkspaceResourceSamResourceId(workspaceId)
}
list3 <- RuntimeServiceDbQueries
.listRuntimes(runtimeIds = Set(c1.samResource, c2.samResource), excludeStatuses = List(RuntimeStatus.Deleted))
.transaction
Expand Down Expand Up @@ -171,9 +164,7 @@ class RuntimeServiceDbQueriesSpec extends AnyFlatSpecLike with TestComponent wit

// Note that c3 exists but is not visible
googleProject = GoogleProject(c1.cloudContext.asString)
projectIds = Set(ProjectSamResourceId(googleProject))
runtimeIds = Set(c1.samResource: SamResourceId, c2.samResource: SamResourceId)
workspaceIds = Set(workspaceId1, workspaceId2).map(WorkspaceResourceSamResourceId)

list0 <- RuntimeServiceDbQueries
.listRuntimes(runtimeIds = runtimeIds)
Expand Down Expand Up @@ -246,10 +237,6 @@ class RuntimeServiceDbQueriesSpec extends AnyFlatSpecLike with TestComponent wit
"creator" -> c2.auditInfo.creator.value
)
runtimeIds = Set(c1.samResource: SamResourceId, c2.samResource: SamResourceId)
bothProjectIds = Set(
ProjectSamResourceId(GoogleProject(c1.cloudContext.asString)),
ProjectSamResourceId(GoogleProject(c2.cloudContext.asString))
)
list0 <- RuntimeServiceDbQueries
.listRuntimes(runtimeIds = runtimeIds, excludeStatuses = List(RuntimeStatus.Deleted))
.transaction
Expand Down Expand Up @@ -317,10 +304,6 @@ class RuntimeServiceDbQueriesSpec extends AnyFlatSpecLike with TestComponent wit
makeCluster(2).saveWithRuntimeConfig(c2RuntimeConfig)
)
runtimeIds = Set(c1.samResource: SamResourceId, c2.samResource: SamResourceId)
bothProjectIds = Set(
ProjectSamResourceId(GoogleProject(c1.cloudContext.asString)),
ProjectSamResourceId(GoogleProject(c2.cloudContext.asString))
)
list1 <- RuntimeServiceDbQueries
.listRuntimes(runtimeIds = runtimeIds,
cloudContext = Some(cloudContextGcp),
Expand Down Expand Up @@ -396,11 +379,6 @@ class RuntimeServiceDbQueriesSpec extends AnyFlatSpecLike with TestComponent wit
)
)
runtimeIds = Set(c1.samResource: SamResourceId, c2.samResource: SamResourceId, c3.samResource: SamResourceId)
projectIds = Set(
ProjectSamResourceId(GoogleProject(c1.cloudContext.asString)),
ProjectSamResourceId(GoogleProject(c2.cloudContext.asString)),
ProjectSamResourceId(GoogleProject(c3.cloudContext.asString))
)

list1 <- RuntimeServiceDbQueries
.listRuntimes(runtimeIds = runtimeIds)
Expand Down Expand Up @@ -460,13 +438,6 @@ class RuntimeServiceDbQueriesSpec extends AnyFlatSpecLike with TestComponent wit
)
)
runtimeIds = Set(c1.samResource: SamResourceId, c2.samResource: SamResourceId, c3.samResource: SamResourceId)
projectIds = Set(
ProjectSamResourceId(GoogleProject(c1.cloudContext.asString)),
ProjectSamResourceId(GoogleProject(c2.cloudContext.asString))
)
workspaceIds = Set(c3.workspaceId).collect { case Some(workspaceId) =>
WorkspaceResourceSamResourceId(workspaceId)
}
list1 <- RuntimeServiceDbQueries
.listRuntimes(runtimeIds = runtimeIds)
.transaction
Expand Down Expand Up @@ -533,7 +504,6 @@ class RuntimeServiceDbQueriesSpec extends AnyFlatSpecLike with TestComponent wit
)
)
runtimeIds = Set(c1.samResource: SamResourceId, c2.samResource: SamResourceId, c3.samResource: SamResourceId)
workspaceIds = Set(workspaceId1, workspaceId2).map(WorkspaceResourceSamResourceId)

list1 <- RuntimeServiceDbQueries
.listRuntimes(runtimeIds = runtimeIds, workspaceId = Some(workspaceId1))
Expand Down Expand Up @@ -624,7 +594,6 @@ class RuntimeServiceDbQueriesSpec extends AnyFlatSpecLike with TestComponent wit
)
c5ClusterRecord <- clusterQuery.getActiveClusterRecordByName(c5.cloudContext, c5.runtimeName).transaction
runtimeIds = Set(c1, c2, c3, c4, c5).map(_.samResource: SamResourceId)
workspaceIds = Set(workspaceId1, workspaceId2).map(WorkspaceResourceSamResourceId)

list1 <- RuntimeServiceDbQueries
.listRuntimes(runtimeIds = runtimeIds,
Expand Down

0 comments on commit d95c38b

Please sign in to comment.