Skip to content

Commit

Permalink
use pre-build openapi client, raise time required for object move
Browse files Browse the repository at this point in the history
  • Loading branch information
dansan committed Nov 25, 2019
1 parent 025c267 commit 1f47464
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,11 @@ pip-install-openapi-client: ## build and install the OpenAPI client library int
make start-docker-container; \
./update_openapi_client --insecure `$(CONTAINER_IP_CMD)` --generator docker; \
fi

pip-install-openapi-client-from-test-pypi: ## install pre-built OpenAPI client library into currently active env
@if $(OPENAPI_CLIENT_LIB_IS_INSTALLED); then \
echo "OpenAPI client lib ('$(OPENAPI_CLIENT_LIB_NAME)') is installed (see 'pip list')."; \
else \
make start-docker-container; \
pip install --compile --upgrade --index-url https://test.pypi.org/simple/ openapi-client-udm; \
fi
4 changes: 2 additions & 2 deletions tests/test_base_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ async def test_move_multiple_objects(
top_cn_dn, top_cn_obj_url, top_cn_data = new_cn()
old_cn_dn, old_cn_obj_url, old_cn_data = new_cn(position=top_cn_dn)
cn_name = old_cn_data["properties"]["name"]
users = dict((num, user_created_via_http(position=old_cn_dn)) for num in range(10))
with patch.object(base_http, "MIN_FOLLOW_REDIRECT_SLEEP_TIME", 2.1):
users = dict((num, user_created_via_http(position=old_cn_dn)) for num in range(20))
with patch.object(base_http, "MIN_FOLLOW_REDIRECT_SLEEP_TIME", 3.0):
async with UDM(**udm_kwargs) as udm:
mod_user = udm.get("users/user")
for dn, url, data in users.values():
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ deps =
whitelist_externals = make
passenv = UCS_CONTAINER_IP UCS_HOST UCS_USERDN UCS_PASSWORD CI TRAVIS TRAVIS_*
commands_pre =
pip install -U pip
make start-docker-container
make pip-install-openapi-client
make pip-install-openapi-client-from-test-pypi
commands =
pytest --basetemp={envtmpdir} --cov=tests --cov=udm_rest_client --cov-fail-under=100 --cov-report=term-missing
codecov
Expand All @@ -29,7 +30,7 @@ deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements_test.txt
isort
commands_pre = make pip-install-openapi-client
commands_pre = make pip-install-openapi-client-from-test-pypi
commands = make lint-isort

[testenv:black]
Expand All @@ -42,7 +43,7 @@ commands = make lint-black
description = invoke sphinx-build to build the HTML docs
basepython = python3
deps = sphinx
commands_pre =
commands_pre = make pip-install-openapi-client-from-test-pypi
commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'

Expand Down

0 comments on commit 1f47464

Please sign in to comment.