Skip to content

Commit cb2476a

Browse files
BTS-2253: Update tests related to V8 enabled/disabled
1 parent 78d66c6 commit cb2476a

File tree

10 files changed

+42
-17
lines changed

10 files changed

+42
-17
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: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func Test_GetServerStatus(t *testing.T) {
143143

144144
func Test_GetDeploymentSupportInfo(t *testing.T) {
145145
Wrap(t, func(t *testing.T, client arangodb.Client) {
146-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
146+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
147147

148148
serverRole, err := client.ServerRole(ctx)
149149
require.NoError(t, err)
@@ -209,7 +209,8 @@ func Test_GetStartupConfiguration(t *testing.T) {
209209
func Test_ReloadRoutingTable(t *testing.T) {
210210
Wrap(t, func(t *testing.T, client arangodb.Client) {
211211
WithDatabase(t, client, nil, func(db arangodb.Database) {
212-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
212+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
213+
requireV8Enabled(client, ctx, t)
213214
err := client.ReloadRoutingTable(ctx, db.Name())
214215
require.NoError(t, err)
215216
})
@@ -221,6 +222,7 @@ func Test_ExecuteAdminScript(t *testing.T) {
221222
Wrap(t, func(t *testing.T, client arangodb.Client) {
222223
WithDatabase(t, client, nil, func(db arangodb.Database) {
223224
withContextT(t, defaultTestTimeout, func(ctx context.Context, tb testing.TB) {
225+
requireV8Enabled(client, ctx, t)
224226
tests := []struct {
225227
name string
226228
script string
@@ -275,7 +277,7 @@ func Test_CompactDatabases(t *testing.T) {
275277
// that may conflict with other tests and server role checks can be inconsistent in parallel execution.
276278

277279
Wrap(t, func(t *testing.T, client arangodb.Client) {
278-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
280+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
279281
if !isNoAuth() {
280282
t.Skip("Skipping: superuser tests run only in no-auth mode (TEST_AUTH=none)")
281283
}
@@ -376,7 +378,7 @@ func validateTLSResponse(t testing.TB, tlsResp arangodb.TLSDataResponse, operati
376378
// Test_ReloadTLSData tests TLS certificate reload functionality, skipping if superuser rights unavailable.
377379
func Test_ReloadTLSData(t *testing.T) {
378380
Wrap(t, func(t *testing.T, client arangodb.Client) {
379-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
381+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
380382
if !isNoAuth() {
381383
t.Skip("Skipping: superuser tests run only in no-auth mode (TEST_AUTH=none)")
382384
}
@@ -397,7 +399,7 @@ func Test_ReloadTLSData(t *testing.T) {
397399
// The test is skipped if superuser rights are missing or the feature is disabled/not configured.
398400
func Test_RotateEncryptionAtRestKey(t *testing.T) {
399401
Wrap(t, func(t *testing.T, client arangodb.Client) {
400-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
402+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
401403
if !isNoAuth() {
402404
t.Skip("Skipping: superuser tests run only in no-auth mode (TEST_AUTH=none)")
403405
}
@@ -464,7 +466,7 @@ func Test_GetJWTSecrets(t *testing.T) {
464466
// Test_ReloadJWTSecrets validates JWT secrets reload functionality, skipping if not available.
465467
func Test_ReloadJWTSecrets(t *testing.T) {
466468
Wrap(t, func(t *testing.T, client arangodb.Client) {
467-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
469+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
468470
resp, err := client.ReloadJWTSecrets(ctx)
469471
if err != nil {
470472
if handleJWTSecretsError(t, err, "ReloadJWTSecrets", []int{http.StatusForbidden, http.StatusBadRequest}) {
@@ -528,7 +530,7 @@ func validateJWTSecretsResponse(t testing.TB, resp arangodb.JWTSecretsResult, op
528530
}
529531
func Test_HandleAdminVersion(t *testing.T) {
530532
Wrap(t, func(t *testing.T, client arangodb.Client) {
531-
withContextT(t, time.Minute, func(ctx context.Context, tb testing.TB) {
533+
withContextT(t, defaultTestTimeout, func(ctx context.Context, tb testing.TB) {
532534
t.Run("With Options", func(t *testing.T) {
533535
resp, err := client.HandleAdminVersion(context.Background(), &arangodb.GetVersionOptions{
534536
Details: utils.NewType(true),
@@ -554,7 +556,7 @@ func Test_HandleAdminVersion(t *testing.T) {
554556
func Test_GetDeploymentId(t *testing.T) {
555557
Wrap(t, func(t *testing.T, client arangodb.Client) {
556558
t.Run("Success case", func(t *testing.T) {
557-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
559+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
558560
version := skipBelowVersion(client, ctx, "3.12.6", t)
559561
t.Logf("Current Version %s", version.Version)
560562

@@ -568,7 +570,7 @@ func Test_GetDeploymentId(t *testing.T) {
568570
})
569571

570572
t.Run("Multiple calls consistency", func(t *testing.T) {
571-
withContextT(t, time.Minute, func(ctx context.Context, t testing.TB) {
573+
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
572574
version := skipBelowVersion(client, ctx, "3.12.6", t)
573575
t.Logf("Current Version %s", version.Version)
574576

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)