Skip to content

Commit d23b95e

Browse files
BTS-2253: Update tests related to V8 enabled/disabled
1 parent f0229ed commit d23b95e

File tree

10 files changed

+43
-18
lines changed

10 files changed

+43
-18
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ parameters:
4141
default: "gcr.io/gcr-for-testing/golang:1.24.9"
4242
arangodbImage:
4343
type: string
44-
default: "public.ecr.aws/b0b8h2r4/enterprise-preview:2025-12-01-devel-d759089-amd64"
44+
default: "gcr.io/gcr-for-testing/arangodb/enterprise-preview:latest"
4545
alpineImage:
4646
type: string
4747
default: "gcr.io/gcr-for-testing/alpine:3.21"

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ GOBUILDTAGSOPT=-tags "$(GOBUILDTAGS)"
2121

2222
ARANGODB ?= arangodb/enterprise:latest
2323
STARTER ?= arangodb/arangodb-starter:latest
24+
# ARANGODB ?= public.ecr.aws/b0b8h2r4/enterprise-preview:2025-12-01-devel-d759089-amd64
25+
# STARTER ?= arangodb/arangodb-starter:local-test
2426

2527
ifdef VERBOSE
2628
TESTVERBOSEOPTIONS := -v

test/asyncjob_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func TestAsyncJobListPending(t *testing.T) {
102102
skipResilientSingle(t)
103103

104104
// for disabling v8 tests
105-
skipBelowVersion(c, "4.0", t)
105+
skipAboveVersion(c, "3.12.6-1", t)
106106

107107
db := ensureDatabase(ctx, c, databaseName("db", "async"), nil, t)
108108
defer func() {
@@ -258,7 +258,7 @@ func TestAsyncJobDelete(t *testing.T) {
258258

259259
t.Run("delete pending job", func(t *testing.T) {
260260
// for disabling v8 tests
261-
skipBelowVersion(c, "4.0", t)
261+
skipAboveVersion(c, "3.12.6-1", t)
262262

263263
idTransaction := runLongRequest(t, ctxAsync, db, 10, col.Name())
264264
require.NotEmpty(t, idTransaction)
@@ -282,7 +282,7 @@ func TestAsyncJobDelete(t *testing.T) {
282282

283283
t.Run("delete expired jobs", func(t *testing.T) {
284284
// for disabling v8 tests
285-
skipBelowVersion(c, "4.0", t)
285+
skipAboveVersion(c, "3.12.6-1", t)
286286

287287
idTransaction := runLongRequest(t, ctxAsync, db, 10, col.Name())
288288
require.NotEmpty(t, idTransaction)

test/client_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,3 +670,17 @@ func checkDBAccess(ctx context.Context, conn driver.Connection, dbName, username
670670

671671
return nil
672672
}
673+
674+
// skipAboveVersion skips the test if the current server version is greater than
675+
// the given version.
676+
func skipAboveVersion(c driver.Client, version driver.Version, t testEnv) driver.VersionInfo {
677+
x, err := c.Version(nil)
678+
if err != nil {
679+
t.Fatalf("Failed to get version info: %s", describe(err))
680+
}
681+
t.Logf("version info %s, version received %s", x.Version, version)
682+
if x.Version.CompareTo(version) > 0 {
683+
t.Skipf("Skipping above version '%s', got version '%s'", version, x.Version)
684+
}
685+
return x
686+
}

test/database_transaction_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
func TestDatabaseTransaction(t *testing.T) {
3535
c := createClient(t, nil)
3636
// for disabling v8 tests
37-
skipBelowVersion(c, "4.0", t)
37+
skipAboveVersion(c, "3.12.6-1", t)
3838

3939
db := ensureDatabase(nil, c, "transaction_test", nil, t)
4040
defer func() {

v2/arangodb/client_admin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ type ClientAdmin interface {
6060
// options of the queried arangod instance.
6161
GetStartupConfigurationDescription(ctx context.Context) (map[string]interface{}, error)
6262

63-
// ReloadRoutingTable reloads the routing information from the _routing system collection.
63+
// ReloadRoutingTable reloads the routing information from the _routing system
64+
// collection, causing Foxx services to rebuild their routing table.
6465
ReloadRoutingTable(ctx context.Context, dbName string) error
6566

6667
// ExecuteAdminScript executes JavaScript code on the server.

v2/tests/admin_cluster_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,10 @@ func Test_ClusterResignLeadership(t *testing.T) {
369369
}
370370

371371
func Test_ClusterStatistics(t *testing.T) {
372+
requireClusterMode(t)
373+
372374
Wrap(t, func(t *testing.T, client arangodb.Client) {
373375
withContextT(t, defaultTestTimeout, func(ctx context.Context, tb testing.TB) {
374-
requireClusterMode(t)
375376
skipBelowVersion(client, ctx, "3.7", t)
376377
// Detect DB-Server ID
377378
serverRole, err := client.ServerRole(ctx)

v2/tests/admin_test.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func Test_GetServerStatus(t *testing.T) {
138138

139139
func Test_GetDeploymentSupportInfo(t *testing.T) {
140140
Wrap(t, func(t *testing.T, client arangodb.Client) {
141-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
141+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
142142

143143
serverRole, err := client.ServerRole(ctx)
144144
require.NoError(t, err)
@@ -160,7 +160,7 @@ func Test_GetDeploymentSupportInfo(t *testing.T) {
160160

161161
func Test_GetStartupConfiguration(t *testing.T) {
162162
Wrap(t, func(t *testing.T, client arangodb.Client) {
163-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
163+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
164164

165165
resp, err := client.GetStartupConfiguration(ctx)
166166
if err != nil {
@@ -220,7 +220,8 @@ func Test_GetStartupConfiguration(t *testing.T) {
220220
func Test_ReloadRoutingTable(t *testing.T) {
221221
Wrap(t, func(t *testing.T, client arangodb.Client) {
222222
WithDatabase(t, client, nil, func(db arangodb.Database) {
223-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
223+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
224+
requireV8Enabled(client, ctx, t)
224225
err := client.ReloadRoutingTable(ctx, db.Name())
225226
require.NoError(t, err)
226227
})
@@ -232,6 +233,7 @@ func Test_ExecuteAdminScript(t *testing.T) {
232233
Wrap(t, func(t *testing.T, client arangodb.Client) {
233234
WithDatabase(t, client, nil, func(db arangodb.Database) {
234235
withContextT(t, defaultTestTimeout, func(ctx context.Context, tb testing.TB) {
236+
requireV8Enabled(client, ctx, t)
235237
tests := []struct {
236238
name string
237239
script string
@@ -283,7 +285,7 @@ func Test_ExecuteAdminScript(t *testing.T) {
283285

284286
func Test_CompactDatabases(t *testing.T) {
285287
Wrap(t, func(t *testing.T, client arangodb.Client) {
286-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
288+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
287289

288290
checkCompact := func(opts *arangodb.CompactOpts) {
289291
resp, err := client.CompactDatabases(ctx, opts)
@@ -404,7 +406,7 @@ func validateTLSResponse(t testing.TB, tlsResp arangodb.TLSDataResponse, operati
404406
// Test_ReloadTLSData tests TLS certificate reload functionality, skipping if superuser rights unavailable.
405407
func Test_ReloadTLSData(t *testing.T) {
406408
Wrap(t, func(t *testing.T, client arangodb.Client) {
407-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
409+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
408410
// Reload TLS data - requires superuser rights
409411
tlsResp, err := client.ReloadTLSData(ctx)
410412
if err != nil {
@@ -437,7 +439,7 @@ func Test_ReloadTLSData(t *testing.T) {
437439
// The test is skipped if superuser rights are missing or the feature is disabled/not configured.
438440
func Test_RotateEncryptionAtRestKey(t *testing.T) {
439441
Wrap(t, func(t *testing.T, client arangodb.Client) {
440-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
442+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
441443

442444
// Attempt to rotate encryption at rest key - requires superuser rights
443445
resp, err := client.RotateEncryptionAtRestKey(ctx)
@@ -502,7 +504,7 @@ func Test_GetJWTSecrets(t *testing.T) {
502504
// Test_ReloadJWTSecrets validates JWT secrets reload functionality, skipping if not available.
503505
func Test_ReloadJWTSecrets(t *testing.T) {
504506
Wrap(t, func(t *testing.T, client arangodb.Client) {
505-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
507+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
506508
resp, err := client.ReloadJWTSecrets(ctx)
507509
if err != nil {
508510
if handleJWTSecretsError(t, err, "ReloadJWTSecrets", []int{http.StatusForbidden, http.StatusBadRequest}) {
@@ -567,7 +569,7 @@ func validateJWTSecretsResponse(t testing.TB, resp arangodb.JWTSecretsResult, op
567569
}
568570
func Test_HandleAdminVersion(t *testing.T) {
569571
Wrap(t, func(t *testing.T, client arangodb.Client) {
570-
withContextT(t, time.Minute, func(ctx context.Context, tb testing.TB) {
572+
withContextT(t, defaultTestTimeout, func(ctx context.Context, tb testing.TB) {
571573
t.Run("With Options", func(t *testing.T) {
572574
resp, err := client.HandleAdminVersion(context.Background(), &arangodb.GetVersionOptions{
573575
Details: utils.NewType(true),
@@ -593,7 +595,7 @@ func Test_HandleAdminVersion(t *testing.T) {
593595
func Test_GetDeploymentId(t *testing.T) {
594596
Wrap(t, func(t *testing.T, client arangodb.Client) {
595597
t.Run("Success case", func(t *testing.T) {
596-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
598+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
597599
version := skipBelowVersion(client, ctx, "3.12.6", t)
598600
t.Logf("Current Version %s", version.Version)
599601

@@ -607,7 +609,7 @@ func Test_GetDeploymentId(t *testing.T) {
607609
})
608610

609611
t.Run("Multiple calls consistency", func(t *testing.T) {
610-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
612+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
611613
version := skipBelowVersion(client, ctx, "3.12.6", t)
612614
t.Logf("Current Version %s", version.Version)
613615

v2/tests/call_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ func Test_CallWithChecks(t *testing.T) {
8787
ok, arangoErr := shared.IsArangoError(err)
8888
require.True(t, ok)
8989
require.True(t, arangoErr.HasError)
90-
require.Equal(t, http.StatusNotFound, resp.Code())
90+
t.Logf("Response code: %d", resp.Code())
91+
require.True(t,
92+
resp.Code() == http.StatusNotFound ||
93+
resp.Code() == http.StatusNotImplemented,
94+
"expected status 404 or 501, got %d", resp.Code())
9195
})
9296
})
9397
})

v2/tests/util_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ func requireV8Enabled(c arangodb.Client, ctx context.Context, t testing.TB) {
146146
versionInfo, err := c.VersionWithOptions(ctx, &arangodb.GetVersionOptions{
147147
Details: utils.NewType(true),
148148
})
149+
t.Logf("V8-Version %s", versionInfo.Details["v8-version"])
149150
if err != nil {
150151
t.Fatalf("Failed to get version info with details: %s", err)
151152
}

0 commit comments

Comments
 (0)