add integrationtests to ci

This commit is contained in:
az 2021-12-01 13:12:45 +01:00
parent 4e876b202c
commit 21e5d84bbb
3 changed files with 20 additions and 2 deletions

View file

@ -4,6 +4,7 @@ stages:
- security
- upload
- image
- integrationtest
services:
- docker:19.03.12-dind
@ -138,4 +139,21 @@ backup-image-test-publish:
rules:
- if: '$CI_COMMIT_TAG != null'
script:
- cd infrastructure/docker-backup && pyb image test publish
- cd infrastructure/docker-backup && pyb image test publish
nextcloud-integrationtest:
stage: integrationtest
image: docker:latest
services:
- docker:dind
dependencies:
- package
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- echo "---------- Integration test -------------"
# - docker build --pull -t "$CI_REGISTRY_IMAGE" .
# - docker run --privileged -dit --name provs_test -v /var/run/docker.sock:/var/run/docker.sock $CI_REGISTRY_IMAGE
# - docker inspect -f '{{.State.Running}}' provs_test
- ./src/test/resources/local-integration-test/setup-docker.sh

View file

View file

@ -39,7 +39,7 @@ function main()
echo
POD=$(kubectl get pod -l app=backup-restore -o name)
kubectl wait $POD --for=condition=Ready --timeout=120s
kubectl wait $POD --for=condition=Ready --timeout=240s
kubectl exec -t $POD -- bash -c "echo \"$ENDPOINT k3stesthost cloudhost\" >> /etc/hosts"
kubectl exec -t $POD -- /usr/local/bin/init.sh
kubectl exec -t $POD -- /usr/local/bin/backup.sh