Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
ca8150e2
C
Cvat
项目概览
疯人忠
/
Cvat
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cvat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ca8150e2
编写于
6月 21, 2022
作者:
K
Kirill Sizov
提交者:
GitHub
6月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Hotfix for CI-nightly (#74)
上级
2e161b0e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
53 addition
and
19 deletion
+53
-19
.github/workflows/main.yml
.github/workflows/main.yml
+23
-13
.github/workflows/schedule.yml
.github/workflows/schedule.yml
+27
-5
tests/rest_api/fixtures/init.py
tests/rest_api/fixtures/init.py
+3
-1
未找到文件。
.github/workflows/main.yml
浏览文件 @
ca8150e2
...
...
@@ -7,9 +7,6 @@ on:
pull_request
:
types
:
[
edited
,
ready_for_review
,
opened
,
synchronize
,
reopened
]
env
:
API_ABOUT_PAGE
:
"
localhost:8080/api/server/about"
jobs
:
cache
:
if
:
|
...
...
@@ -191,11 +188,7 @@ jobs:
npm run coverage
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f components/serverless/docker-compose.serverless.yml build cvat_ui
-
name
:
Running e2e tests
env
:
DJANGO_SU_NAME
:
'
admin'
DJANGO_SU_EMAIL
:
'
admin@localhost.company'
DJANGO_SU_PASSWORD
:
'
12qwaszx'
-
name
:
Run CVAT instance for E2E testing
run
:
|
docker-compose \
-f docker-compose.yml \
...
...
@@ -203,12 +196,29 @@ jobs:
-f components/serverless/docker-compose.serverless.yml \
-f tests/docker-compose.file_share.yml up -d
/bin/bash -c \
'while [[ $(curl -s -o /dev/null -w "%{http_code}" ${{ env.API_ABOUT_PAGE }}) != "401" ]]; do sleep 5; done'
-
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
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
:
Run E2E tests
env
:
DJANGO_SU_NAME
:
'
admin'
DJANGO_SU_EMAIL
:
'
admin@localhost.company'
DJANGO_SU_PASSWORD
:
'
12qwaszx'
run
:
|
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"
cd ./tests
npm ci
...
...
.github/workflows/schedule.yml
浏览文件 @
ca8150e2
...
...
@@ -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
...
...
tests/rest_api/fixtures/init.py
浏览文件 @
ca8150e2
...
...
@@ -2,6 +2,7 @@ import os.path as osp
import
re
from
http
import
HTTPStatus
from
subprocess
import
PIPE
,
CalledProcessError
,
run
from
time
import
sleep
import
pytest
import
os
...
...
@@ -96,10 +97,11 @@ def delete_compose_files():
def
wait_for_server
():
while
True
:
for
_
in
range
(
60
)
:
response
=
requests
.
get
(
get_api_url
(
"users/self"
))
if
response
.
status_code
==
HTTPStatus
.
UNAUTHORIZED
:
break
sleep
(
5
)
def
restore_data_volumes
():
docker_cp
(
osp
.
join
(
CVAT_DB_DIR
,
"cvat_data.tar.bz2"
),
f
"
{
PREFIX
}
_cvat_1:/tmp/cvat_data.tar.bz2"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录