From bdf9aa7dc7aaf2cd900062d476f817f975949066 Mon Sep 17 00:00:00 2001 From: Andrew Sisley Date: Tue, 13 Feb 2024 15:51:35 -0500 Subject: [PATCH] PR FIXUP - Skip test for Http and CLI clients --- .../query/one_to_one/with_version_test.go | 3 +++ tests/integration/test_case.go | 7 +++++++ tests/integration/utils2.go | 14 ++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/tests/integration/query/one_to_one/with_version_test.go b/tests/integration/query/one_to_one/with_version_test.go index 92af71f589..655d9a6562 100644 --- a/tests/integration/query/one_to_one/with_version_test.go +++ b/tests/integration/query/one_to_one/with_version_test.go @@ -13,6 +13,7 @@ package one_to_one import ( "testing" + "github.com/sourcenetwork/immutable" "github.com/stretchr/testify/require" testUtils "github.com/sourcenetwork/defradb/tests/integration" @@ -23,6 +24,8 @@ import ( func TestQueryOneToOne_WithVersionOnOuter(t *testing.T) { test := testUtils.TestCase{ Description: "Embedded commits query within one-one query", + // The CLI and Http clients catch the panic, causing it to fail + SupportedClientTypes: immutable.Some([]testUtils.ClientType{testUtils.GoClientType}), Actions: []any{ testUtils.SchemaUpdate{ Schema: ` diff --git a/tests/integration/test_case.go b/tests/integration/test_case.go index 5fea4d4478..8ca56b1de5 100644 --- a/tests/integration/test_case.go +++ b/tests/integration/test_case.go @@ -38,6 +38,13 @@ type TestCase struct { // This is to only be used in the very rare cases where we really do want behavioural // differences between mutation types, or we need to temporarily document a bug. SupportedMutationTypes immutable.Option[[]MutationType] + + // If provided a value, SupportedClientTypes will cause this test to be skipped + // if the active client type is not within the given set. + // + // This is to only be used in the very rare cases where we really do want behavioural + // differences between mutation types, or we need to temporarily document a bug. + SupportedClientTypes immutable.Option[[]ClientType] } // SetupComplete is a flag to explicitly notify the change detector at which point diff --git a/tests/integration/utils2.go b/tests/integration/utils2.go index cfef7d870f..850e931334 100644 --- a/tests/integration/utils2.go +++ b/tests/integration/utils2.go @@ -160,6 +160,20 @@ func ExecuteTestCase( ctx := context.Background() for _, ct := range clients { + if testCase.SupportedClientTypes.HasValue() { + isSupported := false + for _, supportedClientType := range testCase.SupportedClientTypes.Value() { + if supportedClientType == ct { + isSupported = true + break + } + } + + if !isSupported { + continue + } + } + for _, dbt := range databases { executeTestCase(ctx, t, collectionNames, testCase, dbt, ct) }