|
|
|
|
@ -21,7 +21,7 @@ jobs:
|
|
|
|
|
-d $(gh api /repos/${REPO}/branches/${default_branch} | jq -r '.commit.commit.author.date'))
|
|
|
|
|
|
|
|
|
|
last_night_time=$(date +%s \
|
|
|
|
|
-d $(gh api /repos/${REPO}/actions/workflows/caching.yml/runs | jq -r '.workflow_runs[].updated_at' | sort | tail -1))
|
|
|
|
|
-d $(gh api /repos/${REPO}/actions/workflows/schedule.yml/runs | jq -r '.workflow_runs[].updated_at' | sort | tail -1))
|
|
|
|
|
|
|
|
|
|
echo ::set-output name=last_commit_time::${last_commit_time}
|
|
|
|
|
echo ::set-output name=last_night_time::${last_night_time}
|
|
|
|
|
@ -130,15 +130,37 @@ jobs:
|
|
|
|
|
pytest tests/rest_api/
|
|
|
|
|
pytest tests/rest_api/ --stop-services
|
|
|
|
|
|
|
|
|
|
- name: Build CVAT
|
|
|
|
|
- name: Run CVAT
|
|
|
|
|
run: |
|
|
|
|
|
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f ./tests/docker-compose.email.yml -f tests/docker-compose.file_share.yml -f components/serverless/docker-compose.serverless.yml up -d --build
|
|
|
|
|
|
|
|
|
|
- name: Waiting for server
|
|
|
|
|
env:
|
|
|
|
|
API_ABOUT_PAGE: "localhost:8080/api/server/about"
|
|
|
|
|
run: |
|
|
|
|
|
max_tries=60
|
|
|
|
|
status_code=$(curl -s -o /tmp/server_response -w "%{http_code}" ${API_ABOUT_PAGE})
|
|
|
|
|
while [[ $status_code != "401" && max_tries -gt 0 ]]
|
|
|
|
|
do
|
|
|
|
|
echo Number of attempts left: $max_tries
|
|
|
|
|
echo Status code of response: $status_code
|
|
|
|
|
|
|
|
|
|
sleep 5
|
|
|
|
|
status_code=$(curl -s -o /tmp/server_response -w "%{http_code}" ${API_ABOUT_PAGE})
|
|
|
|
|
(( max_tries-- ))
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
if [[ $status_code != "401" ]]; then
|
|
|
|
|
echo Response from server is incorrect, output:
|
|
|
|
|
cat /tmp/server_response
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
- name: Add user for tests
|
|
|
|
|
env:
|
|
|
|
|
DJANGO_SU_NAME: "admin"
|
|
|
|
|
DJANGO_SU_EMAIL: "admin@localhost.company"
|
|
|
|
|
DJANGO_SU_PASSWORD: "12qwaszx"
|
|
|
|
|
API_ABOUT_PAGE: "localhost:8080/api/server/about"
|
|
|
|
|
run: |
|
|
|
|
|
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f ./tests/docker-compose.email.yml -f tests/docker-compose.file_share.yml -f components/serverless/docker-compose.serverless.yml up -d --build
|
|
|
|
|
/bin/bash -c 'while [[ $(curl -s -o /dev/null -w "%{http_code}" ${API_ABOUT_PAGE}) != "401" ]]; do sleep 5; done'
|
|
|
|
|
docker exec -i cvat /bin/bash -c "echo \"from django.contrib.auth.models import User; User.objects.create_superuser('${DJANGO_SU_NAME}', '${DJANGO_SU_EMAIL}', '${DJANGO_SU_PASSWORD}')\" | python3 ~/manage.py shell"
|
|
|
|
|
|
|
|
|
|
- name: End-to-end testing
|
|
|
|
|
|