test gitlab
This commit is contained in:
parent
36f18bbf10
commit
b0bf115f64
|
@ -4,7 +4,7 @@ jobs:
|
|||
script:
|
||||
# - tests/setup-gitlab.sh
|
||||
- pip install tox
|
||||
- tox
|
||||
- FEDEPROXY_IP=$(ip r show default | cut -f3 -d' ') PYTEST_ADDOPTS='-m "not gitlab"' tox
|
||||
|
||||
after_script:
|
||||
- tests/setup-gitlab.sh cleanup
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
import os
|
||||
import pytest
|
||||
|
||||
from fedeproxy.common.gitlab import GitLab
|
||||
|
||||
|
||||
@pytest.mark.gitlab
|
||||
def test_recreate_project(tmpdir):
|
||||
ip = os.environ.get('FEDEPROXY_IP', '0.0.0.0')
|
||||
gitlab = GitLab(f'http://{ip}:8181')
|
||||
gitlab.login('root', 'Wrobyak4')
|
||||
gitlab.recreate_project('root', 'testproject')
|
|
@ -58,7 +58,7 @@ function run_gitlab() {
|
|||
-e GITLAB_SECRETS_OTP_KEY_BASE=4W44tm7bJFRPWNMVzKngffxVWXRpVs49dxhFwgpx7FbCj3wXCMmsz47LzWsdr7nM \
|
||||
-e GITLAB_ROOT_PASSWORD=Wrobyak4 \
|
||||
-v $DATA/gitlab$serial/data:/home/git/data \
|
||||
sameersbn/gitlab
|
||||
sameersbn/gitlab:13.8.1
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
@ -80,14 +80,9 @@ function main() {
|
|||
run_db $serial
|
||||
run_gitlab $serial
|
||||
done
|
||||
if test "$GITLAB_CI" ; then
|
||||
IP=$(ip r show default | cut -f3 -d' ')
|
||||
else
|
||||
IP=0.0.0.0
|
||||
fi
|
||||
for serial in $serials ; do
|
||||
while true ; do
|
||||
test $(curl --silent http://$IP:818$serial -o /dev/null -w "%{http_code}") = 302 && break
|
||||
test $(curl --silent http://${FEDEPROXY_IP:-0.0.0.0}:818$serial -o /dev/null -w "%{http_code}") = 302 && break
|
||||
sleep 5
|
||||
done
|
||||
done
|
||||
|
@ -96,4 +91,3 @@ function main() {
|
|||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
|
|
Loading…
Reference in New Issue