Skip to content

Commit

Permalink
PR FIXUP - Skip test for Http and CLI clients
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Feb 13, 2024
1 parent 77e961e commit bdf9aa7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/integration/query/one_to_one/with_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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: `
Expand Down
7 changes: 7 additions & 0 deletions tests/integration/test_case.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions tests/integration/utils2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit bdf9aa7

Please sign in to comment.