Skip to content

Commit

Permalink
fixed integration tests after removed ydb 23.3 from matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyasnikov committed Dec 11, 2024
1 parent 6a8c400 commit 5bd342d
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 108 deletions.
4 changes: 0 additions & 4 deletions tests/integration/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"github.com/ydb-platform/ydb-go-sdk/v3/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/credentials"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/meta"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
"github.com/ydb-platform/ydb-go-sdk/v3/log"
"github.com/ydb-platform/ydb-go-sdk/v3/retry"
Expand Down Expand Up @@ -172,9 +171,6 @@ func TestDriver(sourceTest *testing.T) {
}
}()
t.RunSynced("WithStaticCredentials", func(t *xtest.SyncedTest) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("read rows not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}
db, err := ydb.Open(ctx,
os.Getenv("YDB_CONNECTION_STRING"),
ydb.WithAccessTokenCredentials(
Expand Down
5 changes: 0 additions & 5 deletions tests/integration/query_execute_script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,12 @@ import (
"github.com/stretchr/testify/require"

"github.com/ydb-platform/ydb-go-sdk/v3"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
"github.com/ydb-platform/ydb-go-sdk/v3/query"
"github.com/ydb-platform/ydb-go-sdk/v3/table/types"
)

func TestQueryExecuteScript(sourceTest *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
sourceTest.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

t := xtest.MakeSyncedTest(sourceTest)
var (
folder = t.Name()
Expand Down
12 changes: 0 additions & 12 deletions tests/integration/query_execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ import (
)

func TestQueryExecute(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

ctx, cancel := context.WithCancel(xtest.Context(t))
defer cancel()

Expand Down Expand Up @@ -297,10 +293,6 @@ func TestQueryExecute(t *testing.T) {

// https://github.com/ydb-platform/ydb-go-sdk/issues/1456
func TestIssue1456TooManyUnknownTransactions(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

ctx, cancel := context.WithCancel(xtest.Context(t))
defer cancel()

Expand Down Expand Up @@ -411,10 +403,6 @@ func TestIssue1456TooManyUnknownTransactions(t *testing.T) {
}

func TestQueryResultSet(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

t.Run("OK", func(t *testing.T) {
scope := newScope(t)

Expand Down
6 changes: 0 additions & 6 deletions tests/integration/query_multi_result_sets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ import (
"errors"
"fmt"
"io"
"os"
"testing"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/query"
)

func TestQueryMultiResultSets(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

scope := newScope(t)
var i, j, k int
db := scope.Driver()
Expand Down
5 changes: 0 additions & 5 deletions tests/integration/query_range_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,11 @@ import (

"github.com/ydb-platform/ydb-go-sdk/v3"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
"github.com/ydb-platform/ydb-go-sdk/v3/query"
)

func TestQueryRange(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

ctx, cancel := context.WithCancel(xtest.Context(t))
defer cancel()

Expand Down
5 changes: 0 additions & 5 deletions tests/integration/query_read_row_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ import (
"github.com/stretchr/testify/require"

"github.com/ydb-platform/ydb-go-sdk/v3"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
"github.com/ydb-platform/ydb-go-sdk/v3/log"
"github.com/ydb-platform/ydb-go-sdk/v3/query"
"github.com/ydb-platform/ydb-go-sdk/v3/trace"
)

func TestQueryReadRow(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

ctx, cancel := context.WithCancel(xtest.Context(t))
defer cancel()

Expand Down
10 changes: 0 additions & 10 deletions tests/integration/query_regression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"errors"
"fmt"
"io"
"os"
"strconv"
"strings"
"testing"
Expand All @@ -19,7 +18,6 @@ import (
"github.com/ydb-platform/ydb-go-sdk/v3"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/query/options"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/query/tx"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/query"
"github.com/ydb-platform/ydb-go-sdk/v3/table"
"github.com/ydb-platform/ydb-go-sdk/v3/table/types"
Expand Down Expand Up @@ -277,10 +275,6 @@ SELECT $val`,

// https://github.com/ydb-platform/ydb-go-sdk/issues/1506
func TestIssue1506TypedNullPushdown(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

scope := newScope(t)
ctx := scope.Ctx
db := scope.Driver()
Expand Down Expand Up @@ -312,10 +306,6 @@ SELECT CAST($arg1 AS Utf8) AS v1, CAST($arg2 AS Utf8) AS v2
}

func TestReadTwoPartsIntoMemoryIssue1559(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

scope := newScope(t)

var readPartCount int
Expand Down
14 changes: 0 additions & 14 deletions tests/integration/query_tx_execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"context"
"errors"
"fmt"
"os"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -16,15 +15,10 @@ import (
"github.com/ydb-platform/ydb-go-sdk/v3"
internalQuery "github.com/ydb-platform/ydb-go-sdk/v3/internal/query"
baseTx "github.com/ydb-platform/ydb-go-sdk/v3/internal/tx"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/query"
)

func TestQueryTxExecute(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

scope := newScope(t)

t.Run("Default", func(t *testing.T) {
Expand Down Expand Up @@ -243,10 +237,6 @@ func TestQueryTxExecute(t *testing.T) {
}

func TestQueryLazyTxExecute(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

scope := newScope(t)

var (
Expand Down Expand Up @@ -457,10 +447,6 @@ func TestQueryLazyTxExecute(t *testing.T) {
}

func TestQueryWithCommitTxFlag(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

scope := newScope(t)
var count uint64
err := scope.DriverWithLogs().Query().Do(scope.Ctx, func(ctx context.Context, s query.Session) error {
Expand Down
27 changes: 12 additions & 15 deletions tests/integration/retry_budget_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/stretchr/testify/require"

"github.com/ydb-platform/ydb-go-sdk/v3"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
"github.com/ydb-platform/ydb-go-sdk/v3/query"
"github.com/ydb-platform/ydb-go-sdk/v3/retry"
Expand Down Expand Up @@ -91,18 +90,16 @@ func TestRetryBudget(t *testing.T) {
}, table.WithRetryBudget(retryBudget))
require.ErrorIs(t, err, budget.ErrNoQuota)
})
if version.Gte(os.Getenv("YDB_VERSION"), "24.1") {
t.Run("db.Query().Do", func(t *testing.T) {
err := nativeDriver.Query().Do(ctx, func(ctx context.Context, s query.Session) error {
return retry.RetryableError(errors.New("custom error"))
}, query.WithRetryBudget(retryBudget))
require.ErrorIs(t, err, budget.ErrNoQuota)
})
t.Run("db.Query().DoTx", func(t *testing.T) {
err := nativeDriver.Query().DoTx(ctx, func(ctx context.Context, tx query.TxActor) error {
return retry.RetryableError(errors.New("custom error"))
}, query.WithRetryBudget(retryBudget))
require.ErrorIs(t, err, budget.ErrNoQuota)
})
}
t.Run("db.Query().Do", func(t *testing.T) {
err := nativeDriver.Query().Do(ctx, func(ctx context.Context, s query.Session) error {
return retry.RetryableError(errors.New("custom error"))
}, query.WithRetryBudget(retryBudget))
require.ErrorIs(t, err, budget.ErrNoQuota)
})
t.Run("db.Query().DoTx", func(t *testing.T) {
err := nativeDriver.Query().DoTx(ctx, func(ctx context.Context, tx query.TxActor) error {
return retry.RetryableError(errors.New("custom error"))
}, query.WithRetryBudget(retryBudget))
require.ErrorIs(t, err, budget.ErrNoQuota)
})
}
5 changes: 0 additions & 5 deletions tests/integration/sugar_result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/stretchr/testify/require"

"github.com/ydb-platform/ydb-go-sdk/v3"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/query"
"github.com/ydb-platform/ydb-go-sdk/v3/sugar"
"github.com/ydb-platform/ydb-go-sdk/v3/table"
Expand All @@ -21,10 +20,6 @@ import (
)

func TestSugarResult(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down
6 changes: 0 additions & 6 deletions tests/integration/sugar_unmarhall_result_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@ package integration

import (
"context"
"os"
"testing"

"github.com/stretchr/testify/require"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/query/scanner"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
"github.com/ydb-platform/ydb-go-sdk/v3/sugar"
)

func TestSugarUnmarshallResultSet(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

ctx, cancel := context.WithCancel(xtest.Context(t))
defer cancel()

Expand Down
6 changes: 0 additions & 6 deletions tests/integration/sugar_unmarhall_row_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@ package integration

import (
"context"
"os"
"testing"

"github.com/stretchr/testify/require"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/query/scanner"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
"github.com/ydb-platform/ydb-go-sdk/v3/sugar"
)

func TestSugarUnmarshallRow(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("query service not allowed in YDB version '" + os.Getenv("YDB_VERSION") + "'")
}

ctx, cancel := context.WithCancel(xtest.Context(t))
defer cancel()

Expand Down
12 changes: 2 additions & 10 deletions tests/integration/topic_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (

ydb "github.com/ydb-platform/ydb-go-sdk/v3"
"github.com/ydb-platform/ydb-go-sdk/v3/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
"github.com/ydb-platform/ydb-go-sdk/v3/topic/topicoptions"
"github.com/ydb-platform/ydb-go-sdk/v3/topic/topictypes"
Expand Down Expand Up @@ -144,17 +143,13 @@ func TestDescribeTopicConsumer(t *testing.T) {
ctx := xtest.Context(t)
db := connect(t)
topicName := "test-topic-" + t.Name()
setImportant := true
if os.Getenv("YDB_VERSION") != "nightly" && version.Lt(os.Getenv("YDB_VERSION"), "24.1.1") {
setImportant = false
}
var (
supportedCodecs = []topictypes.Codec{topictypes.CodecRaw, topictypes.CodecGzip}
minActivePartitions = int64(2)
consumers = []topictypes.Consumer{
{
Name: "c1",
Important: setImportant,
Important: true,
SupportedCodecs: []topictypes.Codec{topictypes.CodecRaw, topictypes.CodecGzip},
ReadFrom: time.Date(2022, 9, 11, 10, 1, 2, 0, time.UTC),
},
Expand Down Expand Up @@ -184,7 +179,7 @@ func TestDescribeTopicConsumer(t *testing.T) {
Path: path.Join(topicName, "c1"),
Consumer: topictypes.Consumer{
Name: "c1",
Important: setImportant,
Important: true,
SupportedCodecs: []topictypes.Codec{topictypes.CodecRaw, topictypes.CodecGzip},
ReadFrom: time.Date(2022, 9, 11, 10, 1, 2, 0, time.UTC),
Attributes: map[string]string{
Expand Down Expand Up @@ -276,9 +271,6 @@ func TestSchemeList(t *testing.T) {

func TestReaderWithoutConsumer(t *testing.T) {
t.Run("OK", func(t *testing.T) {
if version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("Read topic without consumer implemented since YDB 24.1, test ran for '" + os.Getenv("YDB_VERSION") + "'")
}
scope := newScope(t)
ctx := scope.Ctx

Expand Down
5 changes: 0 additions & 5 deletions tests/integration/topic_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import (
"encoding/json"
"fmt"
"io"
"os"
"path"
"strings"
"testing"

"github.com/stretchr/testify/require"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
"github.com/ydb-platform/ydb-go-sdk/v3/topic/topicoptions"
"github.com/ydb-platform/ydb-go-sdk/v3/topic/topicsugar"
"github.com/ydb-platform/ydb-go-sdk/v3/topic/topicwriter"
Expand Down Expand Up @@ -116,9 +114,6 @@ func TestMessageJsonUnmarshalIterator(t *testing.T) {
}

func TestCDCReaderIterator(t *testing.T) {
if os.Getenv("YDB_VERSION") != "nightly" && version.Lt(os.Getenv("YDB_VERSION"), "24.1") {
t.Skip("require minimum version 24.1 for work with within yql")
}
scope := newScope(t)
ctx := scope.Ctx

Expand Down

0 comments on commit 5bd342d

Please sign in to comment.