From 32bd0969907c80753da9e1b5350f045356027bc4 Mon Sep 17 00:00:00 2001 From: Anthony Seure Date: Mon, 18 Jun 2018 16:44:26 +0200 Subject: [PATCH] chore: Use testify to shorten tests and replace glide with dep --- .travis.yml | 2 +- Gopkg.lock | 28 ++++++++++++++++++++++++++++ Gopkg.toml | 34 ++++++++++++++++++++++++++++++++++ Makefile | 14 +++----------- 4 files changed, 66 insertions(+), 12 deletions(-) create mode 100644 Gopkg.lock create mode 100644 Gopkg.toml diff --git a/.travis.yml b/.travis.yml index a62d75c65..cc01acfed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ go: before_install: - mkdir -p /home/travis/gopath/{src,bin,pkg} - - curl https://glide.sh/get | sh + - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - go get -u github.com/rakyll/gotest install: diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 000000000..98ecee160 --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,28 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/davecgh/go-spew" + packages = ["spew"] + revision = "6d212800a42e8ab5c146b8ace3490ee17e5225f9" + +[[projects]] + name = "github.com/pmezard/go-difflib" + packages = ["difflib"] + revision = "d8ed2627bdf02c080bf22230dbb337003b7aba2d" + +[[projects]] + name = "github.com/stretchr/testify" + packages = [ + "assert", + "require" + ] + revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" + version = "v1.1.4" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "ab6aaa1a718d8cdad1dd9313d144eaf46c9e67ef97806ff6cc8935e9f661bfb3" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 000000000..ad1df92e1 --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,34 @@ +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + + +[[constraint]] + name = "github.com/stretchr/testify" + version = "~1.1.4" + +[prune] + go-tests = true + unused-packages = true diff --git a/Makefile b/Makefile index 7ddddd733..3d166942e 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,12 @@ PROJECT=algoliasearch -COVERAGE_FILE=coverage.out install: go install ./$(PROJECT) deps: - glide install + dep ensure -vendor-only -test: test-unit - -test-unit: +test: gotest -v ./$(PROJECT) -coverage: - go list -f '{{if gt (len .TestGoFiles) 0}}"go test -covermode count -coverprofile {{.Name}}.coverprofile -coverpkg ./... {{.ImportPath}}"{{end}}' ./... | xargs -I {} bash -c {} - gocovmerge `ls *.coverprofile` > $(COVERAGE_FILE) - go tool cover -html=$(COVERAGE_FILE) - -.PHONY: install test clean +.PHONY: install deps test