diff --git a/.travis.yml b/.travis.yml index cce84f7e..e72b543f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ env: global: - PATH=${PATH}:./bin - GO_ENV=test + - ATHENS_MONGO_STORAGE_URL=mongodb://127.0.0.1:27017 - ATHENS_MINIO_ENDPOINT=127.0.0.1:9001 - MINIO_ACCESS_KEY=minio - MINIO_SECRET_KEY=minio123 diff --git a/pkg/storage/mongo/mongo_test.go b/pkg/storage/mongo/mongo_test.go index 22db7d41..7870f2cb 100644 --- a/pkg/storage/mongo/mongo_test.go +++ b/pkg/storage/mongo/mongo_test.go @@ -26,7 +26,7 @@ func BenchmarkBackend(b *testing.B) { } func getStorage(tb testing.TB) *ModuleStore { - url := os.Getenv("ATHENS_MONGO_URL") + url := os.Getenv("ATHENS_MONGO_STORAGE_URL") if url == "" { tb.SkipNow() } diff --git a/scripts/test_unit.sh b/scripts/test_unit.sh index e33a2156..1b3b4ddf 100755 --- a/scripts/test_unit.sh +++ b/scripts/test_unit.sh @@ -6,6 +6,14 @@ if [ -z ${GO_ENV} ]; then export GO_ENV="test" fi +if [ -z ${ATHENS_MINIO_ENDPOINT} ]; then + export ATHENS_MINIO_ENDPOINT="127.0.0.1:9001" +fi + +if [ -z ${ATHENS_MONGO_STORAGE_URL} ]; then + export ATHENS_MONGO_STORAGE_URL="mongodb://127.0.0.1:27017" +fi + export GO111MODULE=on # Run the unit tests with the race detector and code coverage enabled