Skip to content

Commit

Permalink
Make the Python test log less messy (cvat-ai#5456)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecLad authored Dec 16, 2022
1 parent e018b10 commit a6e5813
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions components/analytics/docker-compose.analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion components/serverless/docker-compose.serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
28 changes: 14 additions & 14 deletions tests/python/shared/fixtures/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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()
Expand All @@ -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")
Expand Down

0 comments on commit a6e5813

Please sign in to comment.