Commit 4d61613a authored by Carina Antunes's avatar Carina Antunes
Browse files

ci: add test step

parent 91687222
PAErpplpKIyNRlbpzLB5srPpmSTX3sXGOMiDHKmKsFu1aOzbcDgfFSVQonxP
......@@ -160,12 +160,12 @@ deploy_production:
GIT_STRATEGY: none
########## MERGE REQUESTS ##########
lint_test:
lint:
services:
- docker:dind
stage: test
image: tmaier/docker-compose:latest
script: make build-env lint test
script: make build-env lint
before_script:
- docker info
- docker-compose --version
......@@ -176,3 +176,19 @@ lint_test:
allow_failure: true
tags:
- docker-privileged-xl
test:
services:
- docker:dind
stage: test
image: tmaier/docker-compose:latest
script: make generate-certificates build-env populate-instance load-fixtures test
before_script:
- docker info
- docker-compose --version
- apk add make
- apk add openssl
only:
- merge_requests
tags:
- docker-privileged-xl
......@@ -27,12 +27,12 @@ logs:
.PHONY: logs
populate-instance:
docker-compose -f $(DOCKER_FILE) exec $(SERVICE_NAME) /bin/bash -c \
docker-compose -f $(DOCKER_FILE) exec -T $(SERVICE_NAME) /bin/bash -c \
"sh /opt/invenio/src/scripts/populate-instance.sh"
.PHONY: load-fixtures
load-fixtures:
docker-compose -f $(DOCKER_FILE) exec $(SERVICE_NAME) /bin/bash -c \
docker-compose -f $(DOCKER_FILE) exec -T $(SERVICE_NAME) /bin/bash -c \
"sh /opt/invenio/src/scripts/create-test-user.sh"
.PHONY: load-fixtures
......@@ -60,7 +60,7 @@ generate-certificates:
.PHONY: generate-certificates
test:
docker-compose -f $(DOCKER_FILE) exec $(SERVICE_NAME) /bin/bash -c \
docker-compose -f $(DOCKER_FILE) exec -T $(SERVICE_NAME) /bin/bash -c \
"API_TOKEN=$$(<$(API_TOKEN)) pytest tests -vv;"
.PHONY: test
......
......@@ -11,3 +11,4 @@ invenio users create test@example.com --password test1234 --active
invenio roles create CernSearch-Administrators@cern.ch
invenio roles add test@example.com CernSearch-Administrators@cern.ch
invenio tokens create -n test -u test@example.com > .api_token
echo TOKEN: $(<.api_token)
......@@ -9,4 +9,5 @@
invenio db init
invenio db create
invenio index init
\ No newline at end of file
invenio index init
invenio index list
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment