diff --git a/.travis.yml b/.travis.yml index fa8d8b95..a5130e76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Makefile b/Makefile index d27b6291..0aa2909d 100644 --- a/Makefile +++ b/Makefile @@ -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") @@ -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 @@ -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) \ @@ -387,7 +391,9 @@ __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 @@ -395,7 +401,7 @@ __run_v2_tests: __test_v2_debug__ __test_prepare __test_v2_go_test __test_cleanu __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) \ @@ -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") @@ -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 \ diff --git a/database_graphs.go b/database_graphs.go index f5e013d3..37974f92 100644 --- a/database_graphs.go +++ b/database_graphs.go @@ -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"` diff --git a/edge_collection_documents_impl.go b/edge_collection_documents_impl.go index 18838f07..17dfe09b 100644 --- a/edge_collection_documents_impl.go +++ b/edge_collection_documents_impl.go @@ -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 { diff --git a/test/view_test.go b/test/view_test.go index 0d68edf7..e6d8d34a 100644 --- a/test/view_test.go +++ b/test/view_test.go @@ -30,6 +30,7 @@ import ( driver "github.com/arangodb/go-driver" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -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{}, @@ -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)) @@ -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