mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Enabling API tests in CI
This commit is contained in:
committed by
James Jeffrey
parent
4ddf7c1454
commit
31e14843fe
@@ -62,13 +62,13 @@ test_job:
|
||||
script:
|
||||
- DOCKER_LOCATION=container_ip ./test.sh
|
||||
|
||||
#integration_tests:
|
||||
# stage: test
|
||||
# script:
|
||||
# - go build -o functions-alpine
|
||||
# - docker build -t funcy/functions:latest .
|
||||
integration_tests:
|
||||
stage: test
|
||||
script:
|
||||
- go build -o functions-alpine
|
||||
- docker build -t funcy/functions:latest .
|
||||
# - make docker-test-run-with-bolt
|
||||
# - make docker-test-run-with-mysql
|
||||
- make docker-test-run-with-sqlite3
|
||||
# - make docker-test-run-with-postgres
|
||||
# - make docker-test-run-with-redis
|
||||
|
||||
|
||||
3
Makefile
3
Makefile
@@ -49,6 +49,9 @@ docker-test-run-with-mysql:
|
||||
docker-test-run-with-postgres:
|
||||
./api_test.sh postgres
|
||||
|
||||
ci-docker-test-run-with-sqlite3:
|
||||
docker run --rm -i -v ${CURDIR}:/go/src/gitlab-odx.oracle.com/odx/functions -w /go/src/gitlab-odx.oracle.com/odx/functions -e "datastore=sqlite3" funcy/fn-api-tester
|
||||
|
||||
docker-test:
|
||||
docker run -ti --privileged --rm -e LOG_LEVEL=debug \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
|
||||
@@ -6,6 +6,7 @@ case "$1" in
|
||||
|
||||
docker run --name func-server --privileged -v /var/run/docker.sock:/var/run/docker.sock -d -e NO_PROXY -e HTTP_PROXY -e DOCKER_HOST=${DOCKER_HOST} -e LOG_LEVEL=debug -p 8080:8080 funcy/functions
|
||||
sleep 1
|
||||
docker logs func-server
|
||||
;;
|
||||
|
||||
"mysql" )
|
||||
@@ -17,6 +18,7 @@ case "$1" in
|
||||
export MYSQL_HOST="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' func-mysql-test)"
|
||||
export MYSQL_PORT=3306
|
||||
docker run --name func-server --privileged -d -e NO_PROXY -e HTTP_PROXY -e DOCKER_HOST=${DOCKER_HOST} -e LOG_LEVEL=debug -e "DB_URL=mysql://root:root@tcp(${MYSQL_HOST}:${MYSQL_PORT})/funcs" -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock funcy/functions
|
||||
docker logs func-server
|
||||
|
||||
;;
|
||||
|
||||
@@ -29,6 +31,7 @@ case "$1" in
|
||||
export POSTGRES_HOST="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' func-postgres-test)"
|
||||
export POSTGRES_PORT=5432
|
||||
docker run --name func-server --privileged -d -e NO_PROXY -e HTTP_PROXY -e DOCKER_HOST=${DOCKER_HOST} -e LOG_LEVEL=debug -e "DB_URL=postgres://postgres:root@${POSTGRES_HOST}:${POSTGRES_PORT}/funcs?sslmode=disable" -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock funcy/functions
|
||||
docker logs func-server
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
6
test/fn-api-tests/Dockerfile
Normal file
6
test/fn-api-tests/Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM funcy/go-dind
|
||||
|
||||
ADD . /go/src/gitlab-odx.oracle.com/odx/functions
|
||||
WORKDIR /go/src/gitlab-odx.oracle.com/odx/functions
|
||||
|
||||
CMD ["/bin/sh", "-c", "set -o pipefail && ./api_test.sh sqlite3"]
|
||||
Reference in New Issue
Block a user