Skip to content

dataconnect: re-enable tests for user-defined enums as primary keys. #7186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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 @@ -429,18 +429,13 @@ class EnumIntegrationTest : DemoConnectorIntegrationTestBase() {
//////////////////////////////////////////////////////////////////////////////////////////////////

@Test
@Ignore(
"TODO(b/432793533) Re-enable this test once the emulator crash " +
"caused by the \"EnumKey_GetByKey\" query is fixed."
)
fun enumAsPrimaryKey() = runTest {
N5ekmae3jn.entries.forEach { enumValue ->
val tagValue = Arb.dataConnect.tag().next(rs)
val key = connector.enumKeyInsert.execute(enumValue) { tag = tagValue }.data.key
withClue(key) { key.enumValue shouldBe Known(enumValue) }
// TODO(b/432793533): Uncomment once the "EnumKey_GetByKey" query is uncommented.
// val queryResult = connector.enumKeyGetByKey.execute(key).data
// withClue(queryResult) { queryResult.item?.tag shouldBe tagValue }
withClue(key) { key.enumValue shouldBe enumValue }
val queryResult = connector.enumKeyGetByKey.execute(key).data
withClue(queryResult) { queryResult.item?.tag shouldBe tagValue }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1778,10 +1778,9 @@ mutation EnumKey_Insert($enumValue: N5ekmae3jn!, $tag: String) @auth(level: PUBL
key: enumKey_insert(data: { enumValue: $enumValue, tag: $tag })
}

# TODO(b/432793533) Uncomment once the emulator crash caused by this query is fixed.
#query EnumKey_GetByKey($key: EnumKey_Key!) @auth(level: PUBLIC) {
# item: enumKey(key: $key) { tag }
#}
query EnumKey_GetByKey($key: EnumKey_Key!) @auth(level: PUBLIC) {
item: enumKey(key: $key) { tag }
}

###############################################################################
# Operations for table: type MultipleEnumColumns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import io.kotest.property.checkAll
import kotlinx.coroutines.test.runTest
import kotlinx.serialization.Serializable
import kotlinx.serialization.serializer
import org.junit.Ignore
import org.junit.Test

class EnumIntegrationTest : DataConnectIntegrationTestBase() {
Expand Down Expand Up @@ -605,10 +604,6 @@ class EnumIntegrationTest : DataConnectIntegrationTestBase() {
//////////////////////////////////////////////////////////////////////////////////////////////////

@Test
@Ignore(
"TODO(b/432793533) Re-enable this test once the emulator crash " +
"caused by the \"EnumKey_GetByKey\" query is fixed."
)
fun enumAsPrimaryKey() = runTest {
N5ekmae3jn.entries.forEach { enumValue ->
val tag = Arb.dataConnect.tag().next(rs)
Expand Down