diff --git a/components/analytics/docker-compose.analytics.yml b/components/analytics/docker-compose.analytics.yml index ceae9521..38cf90cc 100644 --- a/components/analytics/docker-compose.analytics.yml +++ b/components/analytics/docker-compose.analytics.yml @@ -54,7 +54,7 @@ services: 'kibana/export.json', ] environment: - no_proxy: elasticsearch,kibana,${no_proxy} + no_proxy: elasticsearch,kibana,${no_proxy:-} logstash: container_name: cvat_logstash @@ -65,8 +65,8 @@ services: context: ./components/analytics/logstash args: ELK_VERSION: 6.8.23 - http_proxy: ${http_proxy} - https_proxy: ${https_proxy} + http_proxy: ${http_proxy:-} + https_proxy: ${https_proxy:-} environment: LOGSTASH_OUTPUT_HOST: elasticsearch:9200 LOGSTASH_OUTPUT_USER: diff --git a/components/serverless/docker-compose.serverless.yml b/components/serverless/docker-compose.serverless.yml index bfd829b8..cf861284 100644 --- a/components/serverless/docker-compose.serverless.yml +++ b/components/serverless/docker-compose.serverless.yml @@ -12,7 +12,7 @@ services: environment: http_proxy: https_proxy: - no_proxy: 172.28.0.1,${no_proxy} + no_proxy: 172.28.0.1,${no_proxy:-} NUCLIO_CHECK_FUNCTION_CONTAINERS_HEALTHINESS: 'true' NUCLIO_DASHBOARD_DEFAULT_FUNCTION_MOUNT_MODE: 'volume' ports: diff --git a/docker-compose.yml b/docker-compose.yml index 3caad0e0..ed81db58 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,7 +40,7 @@ services: CVAT_POSTGRES_HOST: 'cvat_db' ADAPTIVE_AUTO_ANNOTATION: 'false' IAM_OPA_BUNDLE: '1' - no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy} + no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy:-} NUMPROCS: 1 USE_ALLAUTH_SOCIAL_ACCOUNTS: "" SOCIAL_AUTH_GOOGLE_CLIENT_ID: "" @@ -74,7 +74,7 @@ services: environment: CVAT_REDIS_HOST: 'cvat_redis' CVAT_POSTGRES_HOST: 'cvat_db' - no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy} + no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy:-} command: -c supervisord/utils.conf volumes: - cvat_data:/home/django/data @@ -94,7 +94,7 @@ services: environment: CVAT_REDIS_HOST: 'cvat_redis' CVAT_POSTGRES_HOST: 'cvat_db' - no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy} + no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy:-} NUMPROCS: 2 command: -c supervisord/worker.default.conf volumes: @@ -115,7 +115,7 @@ services: environment: CVAT_REDIS_HOST: 'cvat_redis' CVAT_POSTGRES_HOST: 'cvat_db' - no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy} + no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy:-} NUMPROCS: 1 command: -c supervisord/worker.low.conf volumes: @@ -136,7 +136,7 @@ services: environment: CVAT_REDIS_HOST: 'cvat_redis' CVAT_POSTGRES_HOST: 'cvat_db' - no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy} + no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy:-} NUMPROCS: 1 command: -c supervisord/worker.webhooks.conf volumes: diff --git a/tests/python/shared/fixtures/init.py b/tests/python/shared/fixtures/init.py index d16af2f0..b586a93b 100644 --- a/tests/python/shared/fixtures/init.py +++ b/tests/python/shared/fixtures/init.py @@ -238,14 +238,13 @@ def start_services(rebuild=False): docker_cp(CVAT_DB_DIR / "data.json", f"{PREFIX}_cvat_server_1:/tmp/data.json") -@pytest.fixture(autouse=True, scope="session") -def services(request): - stop = request.config.getoption("--stop-services") - start = request.config.getoption("--start-services") - rebuild = request.config.getoption("--rebuild") - cleanup = request.config.getoption("--cleanup") - dumpdb = request.config.getoption("--dumpdb") - platform = request.config.getoption("--platform") +def pytest_sessionstart(session): + stop = session.config.getoption("--stop-services") + start = session.config.getoption("--start-services") + rebuild = session.config.getoption("--rebuild") + cleanup = session.config.getoption("--cleanup") + dumpdb = session.config.getoption("--dumpdb") + platform = session.config.getoption("--platform") if platform == "kube" and any((stop, start, rebuild, cleanup, dumpdb)): raise Exception( @@ -297,11 +296,6 @@ def services(request): if start: pytest.exit("All necessary containers have been created and started.", returncode=0) - yield - - docker_restore_db() - docker_exec_cvat_db("dropdb test_db") - elif platform == "kube": kube_restore_data_volumes() server_pod_name = _kube_get_server_pod_name() @@ -321,7 +315,13 @@ def services(request): ] ) - yield + +def pytest_sessionfinish(session, exitstatus): + platform = session.config.getoption("--platform") + + if platform == "local": + docker_restore_db() + docker_exec_cvat_db("dropdb test_db") @pytest.fixture(scope="function")