Skip to content

Commit

Permalink
Fix migration error in CRON type of CI. (#2606)
Browse files Browse the repository at this point in the history
* Wait response from API `/server/about` before creating superuser in cron tests

Co-authored-by: Kruchinin <[email protected]>
  • Loading branch information
dvkruchinin and Kruchinin authored Dec 22, 2020
1 parent 83193d0 commit 4816808
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
DJANGO_SU_EMAIL="[email protected]"
DJANGO_SU_PASSWORD="12qwaszx"
NODE_VERSION="12"
API_ABOUT_PAGE="localhost:8080/api/v1/server/about"

before_install:
- nvm install ${NODE_VERSION}
Expand All @@ -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;
Expand Down

0 comments on commit 4816808

Please sign in to comment.