diff options
author | vitalyisaev <vitalyisaev@ydb.tech> | 2023-11-30 13:26:22 +0300 |
---|---|---|
committer | vitalyisaev <vitalyisaev@ydb.tech> | 2023-11-30 15:44:45 +0300 |
commit | 0a98fece5a9b54f16afeb3a94b3eb3105e9c3962 (patch) | |
tree | 291d72dbd7e9865399f668c84d11ed86fb190bbf /library/recipes/docker_compose/example_with_context | |
parent | cb2c8d75065e5b3c47094067cb4aa407d4813298 (diff) | |
download | ydb-0a98fece5a9b54f16afeb3a94b3eb3105e9c3962.tar.gz |
YQ Connector:Use docker-compose in integrational tests
Diffstat (limited to 'library/recipes/docker_compose/example_with_context')
4 files changed, 53 insertions, 0 deletions
diff --git a/library/recipes/docker_compose/example_with_context/docker-compose.yml b/library/recipes/docker_compose/example_with_context/docker-compose.yml new file mode 100644 index 0000000000..d92d094247 --- /dev/null +++ b/library/recipes/docker_compose/example_with_context/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3.4' +services: + sweb: + build: + context: $main + network: host + ports: + - "5000:5000" + redis: + image: "redis:alpine@sha256:66ccc75f079ab9059c900e9545bbd271bff78a66f94b45827e6901f57fb973f1" diff --git a/library/recipes/docker_compose/example_with_context/docker-context.yml b/library/recipes/docker_compose/example_with_context/docker-context.yml new file mode 100644 index 0000000000..19adc96fad --- /dev/null +++ b/library/recipes/docker_compose/example_with_context/docker-context.yml @@ -0,0 +1,5 @@ +main: + - build://devtools/dummy_arcadia/hello_world/hello_world: bin/hello + - arcadia://library/recipes/docker_compose/example/Dockerfile: Dockerfile + - arcadia://library/recipes/docker_compose/example/app.py: app.py + - arcadia://library/recipes/docker_compose/example/requirements.txt: requirements.txt diff --git a/library/recipes/docker_compose/example_with_context/test.py b/library/recipes/docker_compose/example_with_context/test.py new file mode 100644 index 0000000000..b7f13fb105 --- /dev/null +++ b/library/recipes/docker_compose/example_with_context/test.py @@ -0,0 +1,9 @@ +import urllib.request + + +def test_compose_works(): + # import pdb; pdb.set_trace() + + request = urllib.request.urlopen("http://localhost:5000") + response = request.read().decode(request.headers.get_content_charset()) + assert 'Hello World!' in response diff --git a/library/recipes/docker_compose/example_with_context/ya.make b/library/recipes/docker_compose/example_with_context/ya.make new file mode 100644 index 0000000000..b1dde5e827 --- /dev/null +++ b/library/recipes/docker_compose/example_with_context/ya.make @@ -0,0 +1,29 @@ +PY3TEST() + +TEST_SRCS( + test.py +) + +# To use docker-compose.yml from another directory, set DOCKER_COMPOSE_FILE variable with Arcadia relative path to the file +# and do not forget to add the directory to the DATA macro, e.g.: +# SET(DOCKER_COMPOSE_FILE library/recipes/docker_compose/test/docker-compose-1.yml) +# DATA(arcadia/library/recipes/docker_compose/test) + +SET(DOCKER_CONTEXT_FILE library/recipes/docker_compose/example_with_context/docker-context.yml) + +INCLUDE(${ARCADIA_ROOT}/library/recipes/docker_compose/recipe.inc) + +TAG( + ya:external + ya:force_sandbox +) + +DATA( + arcadia/library/recipes/docker_compose/example +) + +DEPENDS( + devtools/dummy_arcadia/hello_world +) + +END() |