mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* idle_timeout max of 1h * timeout max of 120s for sync, 1h for async * max memory of 8GB * do full route validation before call invocation * ensure that idle_timeout >= timeout we are now doing validation of updating route inside of the database transaction, which is what we should have been doing all along really. we need this behavior to ensure that the idle timeout is longer than the timeout, among other benefits (like not updating the most recent version of the existing struct and overwriting previous updates, yay). since we have this, we can get rid of the weird skipZero behavior on validate too and validate the real deal holyfield. validating the route before making the call is handy so that we don't do weird things like run a func that wants to use 300GB of RAM and run for 3 weeks. closes #192 closes #344 closes #162
50 lines
1.5 KiB
Bash
Executable File
50 lines
1.5 KiB
Bash
Executable File
# Top level test script to start all other tests
|
|
|
|
set -ex
|
|
|
|
docker rm -fv func-postgres-test || echo No prev test db container
|
|
docker run --name func-postgres-test -p 15432:5432 -d postgres
|
|
docker rm -fv func-mysql-test || echo No prev mysql test db container
|
|
docker run --name func-mysql-test -p 3307:3306 -e MYSQL_DATABASE=funcs -e MYSQL_ROOT_PASSWORD=root -d mysql
|
|
sleep 5
|
|
case ${DOCKER_LOCATION:-localhost} in
|
|
localhost)
|
|
export POSTGRES_HOST=localhost
|
|
export POSTGRES_PORT=15432
|
|
|
|
export MYSQL_HOST=localhost
|
|
export MYSQL_PORT=3307
|
|
;;
|
|
docker_ip)
|
|
if [[ ! -z ${DOCKER_HOST} ]]
|
|
then
|
|
DOCKER_IP=`echo ${DOCKER_HOST} | awk -F/ '{print $3}'| awk -F: '{print $1}'`
|
|
fi
|
|
export POSTGRES_HOST=${DOCKER_IP:-localhost}
|
|
export POSTGRES_PORT=15432
|
|
|
|
export MYSQL_HOST=${DOCKER_IP:-localhost}
|
|
export MYSQL_PORT=3307
|
|
;;
|
|
container_ip)
|
|
export POSTGRES_HOST="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' func-postgres-test)"
|
|
export POSTGRES_PORT=5432
|
|
|
|
export MYSQL_HOST="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' func-mysql-test)"
|
|
export MYSQL_PORT=3306
|
|
;;
|
|
esac
|
|
|
|
go test -v $(go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v cli | grep -v tmp/go/src | grep -v test/fn-api-tests)
|
|
docker rm --force func-postgres-test
|
|
docker rm --force func-mysql-test
|
|
|
|
# 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 ../..
|