Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ language: go

env:
- TEST_SUITE=run-unit-tests GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch ALWAYS=1
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb:3.6
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb:3.7
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb:3.8
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb/arangodb:latest ALWAYS=1
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.6.16
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.7.17
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.8.5.1
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.9.0 ALWAYS=1
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb/arangodb-preview:latest TEST_DISALLOW_UNKNOWN_FIELDS=false
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb:3.6
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb:3.7
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb:3.8
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb/arangodb:latest ALWAYS=1
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.6.16
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.7.17
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.8.5.1
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.9.0 ALWAYS=1
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.16.6-stretch STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb/arangodb-preview:latest

script:
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ ! -z "$ALWAYS" ]; then make $TEST_SUITE TEST_RESOURCES="$HOME/resources/" VERBOSE=1; fi'
- |
if [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ ! -z "$ALWAYS" ]; then
make $TEST_SUITE TEST_RESOURCES="$HOME/resources/" VERBOSE=1;
fi
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ else ifeq ("$(TEST_AUTH)", "jwt")
ARANGOARGS := --server.jwt-secret=/jwtsecret
endif

TEST_NET := container:$(TESTCONTAINER)-ns
TEST_NET := --net=container:$(TESTCONTAINER)-ns
TEST_ENDPOINTS := http://localhost:7001
TESTS := $(REPOPATH)/test
ifeq ("$(TEST_AUTH)", "rootpw")
Expand Down Expand Up @@ -105,10 +105,14 @@ ifeq ("$(TEST_BENCHMARK)", "true")
endif

ifdef TEST_ENDPOINTS_OVERRIDE
TEST_NET := host
TEST_NET := --net=host
TEST_ENDPOINTS := $(TEST_ENDPOINTS_OVERRIDE)
endif

ifdef TEST_NET_OVERRIDE
TEST_NET := $(TEST_NET_OVERRIDE)
endif

ifdef ENABLE_VST11
VST11_SINGLE_TESTS := run-tests-single-vst-1.1
VST11_RESILIENTSINGLE_TESTS := run-tests-resilientsingle-vst-1.1
Expand Down Expand Up @@ -367,7 +371,7 @@ __run_tests: __test_debug__ __test_prepare __test_go_test __test_cleanup
__test_go_test:
$(DOCKER_CMD) \
--name=$(TESTCONTAINER) \
--net=$(TEST_NET) \
$(TEST_NET) \
-v "${ROOTDIR}":/usr/code ${TEST_RESOURCES_VOLUME} \
-e TEST_ENDPOINTS=$(TEST_ENDPOINTS) \
-e TEST_NOT_WAIT_UNTIL_READY=$(TEST_NOT_WAIT_UNTIL_READY) \
Expand All @@ -387,15 +391,17 @@ __test_go_test:
-e GODEBUG=tls13=1 \
-e CGO_ENABLED=$(CGO_ENABLED) \
-w /usr/code/ \
$(DOCKER_RUN_CMD)
$(DOCKER_RUN_CMD) && echo "success!" || \
{ echo "failure! \n\nARANGODB-STARTER logs:"; docker logs ${TESTCONTAINER}-s; \
echo "\nARANGODB logs:"; docker ps -f name=${TESTCONTAINER}-s- -q | xargs -L 1 docker logs; exit 1; }

# Internal test tasks
__run_v2_tests: __test_v2_debug__ __test_prepare __test_v2_go_test __test_cleanup

__test_v2_go_test:
$(DOCKER_CMD) \
--name=$(TESTCONTAINER) \
--net=$(TEST_NET) \
$(TEST_NET) \
-v "${ROOTDIR}":/usr/code:ro ${TEST_RESOURCES_VOLUME} \
-e TEST_ENDPOINTS=$(TEST_ENDPOINTS) \
-e TEST_NOT_WAIT_UNTIL_READY=$(TEST_NOT_WAIT_UNTIL_READY) \
Expand All @@ -409,7 +415,9 @@ __test_v2_go_test:
-e GODEBUG=tls13=1 \
-e CGO_ENABLED=$(CGO_ENABLED) \
-w /usr/code/v2/ \
$(DOCKER_V2_RUN_CMD)
$(DOCKER_V2_RUN_CMD) && echo "success!" || \
{ echo "failure! \n\nARANGODB-STARTER logs:"; docker logs ${TESTCONTAINER}-s; \
echo "\nARANGODB logs:"; docker ps -f name=${TESTCONTAINER}-s- -q | xargs -L 1 docker logs; exit 1; }

__test_debug__:
ifeq ("$(DEBUG)", "true")
Expand Down Expand Up @@ -456,7 +464,7 @@ run-tests-cluster-failover:
go get github.com/coreos/go-iptables/iptables
$(DOCKER_CMD) \
--rm \
--net=container:$(TESTCONTAINER)-ns \
$(TEST_NET) \
--privileged \
-v "${ROOTDIR}":/usr/code \
-e TEST_ENDPOINTS=http://127.0.0.1:7001,http://127.0.0.1:7006,http://127.0.0.1:7011 \
Expand Down
2 changes: 1 addition & 1 deletion database_graphs.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type CreateGraphOptions struct {
type EdgeDefinition struct {
// The name of the edge collection to be used.
Collection string `json:"collection"`
// To contains the names of one or more edge collections that can contain target vertices.
// To contains the names of one or more vertex collections that can contain target vertices.
To []string `json:"to"`
// From contains the names of one or more vertex collections that can contain source vertices.
From []string `json:"from"`
Expand Down
2 changes: 1 addition & 1 deletion edge_collection_documents_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ func (c *edgeCollection) removeDocument(ctx context.Context, key string) (Docume
}
cs := applyContextSettings(ctx, req)
if cs.ReturnOld != nil {
return DocumentMeta{}, contextSettings{}, WithStack(InvalidArgumentError{Message: "ReturnOld is not support when removing edges"})
return DocumentMeta{}, contextSettings{}, WithStack(InvalidArgumentError{Message: "ReturnOld is not supported when removing edges"})
}
resp, err := c.conn.Do(ctx, req)
if err != nil {
Expand Down
20 changes: 19 additions & 1 deletion test/view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

driver "github.com/arangodb/go-driver"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -509,13 +510,15 @@ func TestUseArangoSearchView(t *testing.T) {
func TestArangoSearchViewProperties35(t *testing.T) {
ctx := context.Background()
c := createClientFromEnv(t, true)
skipBelowVersion(c, "3.5", t)
skipBelowVersion(c, "3.7.1", t)
db := ensureDatabase(ctx, c, "view_test", nil, t)
ensureCollection(ctx, db, "someCol", nil, t)
commitInterval := int64(100)
sortDir := driver.ArangoSearchSortDirectionDesc
name := "test_get_asview_35"
sortField := "foo"
storedValuesFields := []string{"now", "is", "the", "time"}
storedValuesCompression := driver.PrimarySortCompressionNone
opts := &driver.ArangoSearchViewProperties{
Links: driver.ArangoSearchLinks{
"someCol": driver.ArangoSearchElementProperties{},
Expand All @@ -525,6 +528,10 @@ func TestArangoSearchViewProperties35(t *testing.T) {
Field: sortField,
Direction: &sortDir,
}},
StoredValues: []driver.StoredValue{{
Fields: storedValuesFields,
Compression: storedValuesCompression,
}},
}
if _, err := db.CreateArangoSearchView(ctx, name, opts); err != nil {
t.Fatalf("Failed to create view '%s': %s", name, describe(err))
Expand Down Expand Up @@ -554,6 +561,17 @@ func TestArangoSearchViewProperties35(t *testing.T) {
t.Errorf("Primary Sort field is wrong: %s, expected %s", ps.Field, sortField)
}
}

if len(p.StoredValues) != 1 {
t.Fatalf("StoredValues expected length: %d, found %d", 1, len(p.StoredValues))
} else {
sv := p.StoredValues[0]
if !assert.Equal(t, sv.Fields, storedValuesFields) {
t.Errorf("StoredValues field is wrong: %s, expected %s", sv.Fields, storedValuesFields)
} else if sv.Compression != storedValuesCompression {
t.Errorf("StoredValues Compression is wrong: %s, expected %s", sv.Compression, storedValuesCompression)
}
}
}

// TestArangoSearchPrimarySort
Expand Down