未验证 提交 4816808b 编写于 作者: D Dmitry Kruchinin 提交者: GitHub

Fix migration error in CRON type of CI. (#2606)

* Wait response from API `/server/about` before creating superuser in cron tests
Co-authored-by: NKruchinin <dmitryx.kruchinin@intel.com>
上级 83193d06
......@@ -23,6 +23,7 @@ env:
DJANGO_SU_EMAIL="admin@localhost.company"
DJANGO_SU_PASSWORD="12qwaszx"
NODE_VERSION="12"
API_ABOUT_PAGE="localhost:8080/api/v1/server/about"
before_install:
- nvm install ${NODE_VERSION}
......@@ -34,7 +35,7 @@ script:
- if [[ $TRAVIS_EVENT_TYPE == "cron" && $TRAVIS_BRANCH == "develop" ]];
then
docker-compose -f docker-compose.yml -f ./tests/docker-compose.email.yml up -d --build;
docker exec -it cvat bash -ic 'python3 ~/manage.py migrate';
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${API_ABOUT_PAGE})" != "401" ]]; do sleep 5; done';
docker exec -it cvat bash -ic "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";
cd ./tests && npm install && npm run cypress:run:firefox; exit $?;
fi;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册