fn: circleci and makefile adjustments (#625)

* fn: circleci and makefile adjustments

*) Moved more tasks into Makefile to allow for
parallelism and dependency checks.
*) Added cpu count in circleci make invocations
for parallelism

* fn: typo sqlite => sqlite3

* fn: removed unnecessary make pull & install
This commit is contained in:
Tolga Ceylan
2017-12-23 08:12:18 -08:00
committed by Reed Allman
parent ae8e87f877
commit d329e0ef5b
5 changed files with 55 additions and 35 deletions

32
test.sh
View File

@@ -22,21 +22,18 @@ function host {
esac
}
docker rm -fv func-postgres-test || echo No prev test db container
function remove_containers {
docker rm -fv func-postgres-test 2>/dev/null || true
docker rm -fv func-mysql-test 2>/dev/null || true
docker rm -fv func-minio-test 2>/dev/null || true
}
remove_containers
docker run --name func-postgres-test -e "POSTGRES_DB=funcs" -e "POSTGRES_PASSWORD=root" -p 5432:5432 -d postgres
docker rm -fv func-mysql-test || echo No prev mysql test db container
docker run --name func-mysql-test -p 3306:3306 -e MYSQL_DATABASE=funcs -e MYSQL_ROOT_PASSWORD=root -d mysql
docker rm -fv func-minio-test || echo No prev minio test container
docker run -d -p 9000:9000 --name func-minio-test -e "MINIO_ACCESS_KEY=admin" -e "MINIO_SECRET_KEY=password" minio/minio server /data
# build test image locally first
(cd images/fn-test-utils && ./build.sh)
# pull all images used in tests so that tests don't time out and fail spuriously
docker pull fnproject/sleeper
docker pull fnproject/error
docker pull fnproject/hello
MYSQL_HOST=`host func-mysql-test`
MYSQL_PORT=3306
@@ -52,17 +49,8 @@ export MINIO_URL="s3://admin:password@${MINIO_HOST}:${MINIO_PORT}/us-east-1/fnlo
go test $(go list ./... | grep -v vendor | grep -v examples | grep -v test/fn-api-tests | grep -v images/fn-test-utils)
go vet $(go list ./... | grep -v vendor)
docker rm --force func-postgres-test
docker rm --force func-mysql-test
docker rm --force func-minio-test
remove_containers
docker run -v `pwd`:/go/src/github.com/fnproject/fn --rm quay.io/goswagger/swagger validate /go/src/github.com/fnproject/fn/docs/swagger.yml
# test middlware, extensions, examples, etc
# TODO: do more here, maybe as part of fn tests
cd examples/middleware
go build
cd ../..
cd examples/extensions
go build
cd ../..