Skip to content

Commit

Permalink
[CLIENT-2461] Remove the tests that depend on nsup-period from dbaas …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
khaf committed Aug 11, 2023
1 parent 422f60f commit b287427
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 48 deletions.
6 changes: 6 additions & 0 deletions client_object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ import (
// ALL tests are isolated by SetName and Key, which are 50 random characters
var _ = gg.Describe("Aerospike", func() {

gg.BeforeEach(func() {
if *dbaas {
gg.Skip("Not supported in DBAAS environment")
}
})

for _, useBoolType := range []bool{false, true} {

gg.BeforeEach(func() {
Expand Down
13 changes: 2 additions & 11 deletions exp_bit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ package aerospike_test

import (
as "github.com/aerospike/aerospike-client-go/v6"
"github.com/aerospike/aerospike-client-go/v6/internal/atomic"

gg "github.com/onsi/ginkgo/v2"
gm "github.com/onsi/gomega"
)

// ALL tests are isolated by SetName and Key, which are 50 random characters
var _ = gg.Describe("Expression Filters - Bitwise", func() {
var _ = gg.Describe("Expression Filters - Bitwise", gg.Ordered, func() {

const keyCount = 100

Expand All @@ -32,13 +31,7 @@ var _ = gg.Describe("Expression Filters - Bitwise", func() {
var wpolicy = as.NewWritePolicy(0, 0)
var qpolicy = as.NewQueryPolicy()

insertRecs := atomic.NewBool(true)

gg.BeforeEach(func() {
if !insertRecs.Get() {
return
}

gg.BeforeAll(func() {
for ii := 0; ii < keyCount; ii++ {
key, _ := as.NewKey(ns, set, ii)
bin := as.BinMap{"bin": []byte{0b00000001, 0b01000010}}
Expand Down Expand Up @@ -69,8 +62,6 @@ var _ = gg.Describe("Expression Filters - Bitwise", func() {
_, err = client.Operate(nil, key, ops...)
gm.Expect(err).NotTo(gm.HaveOccurred())
}

insertRecs.Set(false)
})

runQuery := func(filter *as.Expression, set_name string) *as.Recordset {
Expand Down
13 changes: 2 additions & 11 deletions exp_hll_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ package aerospike_test

import (
as "github.com/aerospike/aerospike-client-go/v6"
"github.com/aerospike/aerospike-client-go/v6/internal/atomic"

gg "github.com/onsi/ginkgo/v2"
gm "github.com/onsi/gomega"
)

// ALL tests are isolated by SetName and Key, which are 50 random characters
var _ = gg.Describe("Expression Filters - HLL", func() {
var _ = gg.Describe("Expression Filters - HLL", gg.Ordered, func() {

const keyCount = 100

Expand All @@ -32,13 +31,7 @@ var _ = gg.Describe("Expression Filters - HLL", func() {
var wpolicy = as.NewWritePolicy(0, 0)
var qpolicy = as.NewQueryPolicy()

insertRecs := atomic.NewBool(true)

gg.BeforeEach(func() {
if !insertRecs.Get() {
return
}

gg.BeforeAll(func() {
for ii := 0; ii < keyCount; ii++ {
key, _ := as.NewKey(ns, set, ii)
bin := as.BinMap{"bin": ii, "lbin": []interface{}{ii, "a"}}
Expand Down Expand Up @@ -69,8 +62,6 @@ var _ = gg.Describe("Expression Filters - HLL", func() {
_, err = client.Operate(nil, key, ops...)
gm.Expect(err).NotTo(gm.HaveOccurred())
}

insertRecs.Set(false)
})

runQuery := func(filter *as.Expression, set_name string) *as.Recordset {
Expand Down
14 changes: 2 additions & 12 deletions exp_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ package aerospike_test

import (
as "github.com/aerospike/aerospike-client-go/v6"
"github.com/aerospike/aerospike-client-go/v6/internal/atomic"

gg "github.com/onsi/ginkgo/v2"
gm "github.com/onsi/gomega"
)

// ALL tests are isolated by SetName and Key, which are 50 random characters
var _ = gg.Describe("Expression Filters - Lists", func() {
var _ = gg.Describe("Expression Filters - Lists", gg.Ordered, func() {

const keyCount = 100

Expand All @@ -32,23 +31,14 @@ var _ = gg.Describe("Expression Filters - Lists", func() {
var wpolicy = as.NewWritePolicy(0, 0)
var qpolicy = as.NewQueryPolicy()

insertRecs := atomic.NewBool(true)

gg.BeforeEach(func() {
if !insertRecs.Get() {
return
}

wpolicy = as.NewWritePolicy(0, 24*60*60)
gg.BeforeAll(func() {
for ii := 0; ii < keyCount; ii++ {
key, _ := as.NewKey(ns, set, ii)
ibin := as.NewBin("bin", []int{1, 2, 3, ii})
client.Delete(wpolicy, key)
err := client.PutBins(wpolicy, key, ibin)
gm.Expect(err).NotTo(gm.HaveOccurred())
}

insertRecs.Set(false)
})

runQuery := func(filter *as.Expression, set_name string) *as.Recordset {
Expand Down
14 changes: 2 additions & 12 deletions exp_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ package aerospike_test

import (
as "github.com/aerospike/aerospike-client-go/v6"
"github.com/aerospike/aerospike-client-go/v6/internal/atomic"

gg "github.com/onsi/ginkgo/v2"
gm "github.com/onsi/gomega"
)

// ALL tests are isolated by SetName and Key, which are 50 random characters
var _ = gg.Describe("Expression Filters - Maps", func() {
var _ = gg.Describe("Expression Filters - Maps", gg.Ordered, func() {

const keyCount = 100

Expand All @@ -32,23 +31,14 @@ var _ = gg.Describe("Expression Filters - Maps", func() {
var wpolicy = as.NewWritePolicy(0, 0)
var qpolicy = as.NewQueryPolicy()

insertRecs := atomic.NewBool(true)

gg.BeforeEach(func() {
if !insertRecs.Get() {
return
}

wpolicy = as.NewWritePolicy(0, 24*60*60)
gg.BeforeAll(func() {
for ii := 0; ii < keyCount; ii++ {
key, _ := as.NewKey(ns, set, ii)
ibin := as.BinMap{"bin": map[string]interface{}{"test": ii, "test2": "a"}}
client.Delete(wpolicy, key)
err := client.Put(wpolicy, key, ibin)
gm.Expect(err).NotTo(gm.HaveOccurred())
}

insertRecs.Set(false)
})

runQuery := func(filter *as.Expression, set_name string) *as.Recordset {
Expand Down
2 changes: 0 additions & 2 deletions expression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ var _ = gg.Describe("Expression Filters", func() {
dropIndex(nil, ns, set, "intval")
dropIndex(nil, ns, set, "strval")

wpolicy = as.NewWritePolicy(0, 24*60*60)

starbucks := [][2]float64{
{-122.1708441, 37.4241193},
{-122.1492040, 37.4273569},
Expand Down
2 changes: 2 additions & 0 deletions marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (

// UseNativeBoolTypeInReflection determines if Boolean values should be directly translated to native Boolean type in reflection API
// introduced in server version 5.6+. By default it keeps the old behavior, but can be set to true to opt in.
//
// Deprecated: Will be removed in the next major version.
var UseNativeBoolTypeInReflection = false

var aerospikeTag = "as"
Expand Down

0 comments on commit b287427

Please sign in to comment.