Make the Python test log less messy (#5456)

main
Roman Donchenko 3 years ago committed by GitHub
parent e018b10e00
commit a6e5813233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -54,7 +54,7 @@ services:
'kibana/export.json', 'kibana/export.json',
] ]
environment: environment:
no_proxy: elasticsearch,kibana,${no_proxy} no_proxy: elasticsearch,kibana,${no_proxy:-}
logstash: logstash:
container_name: cvat_logstash container_name: cvat_logstash
@ -65,8 +65,8 @@ services:
context: ./components/analytics/logstash context: ./components/analytics/logstash
args: args:
ELK_VERSION: 6.8.23 ELK_VERSION: 6.8.23
http_proxy: ${http_proxy} http_proxy: ${http_proxy:-}
https_proxy: ${https_proxy} https_proxy: ${https_proxy:-}
environment: environment:
LOGSTASH_OUTPUT_HOST: elasticsearch:9200 LOGSTASH_OUTPUT_HOST: elasticsearch:9200
LOGSTASH_OUTPUT_USER: LOGSTASH_OUTPUT_USER:

@ -12,7 +12,7 @@ services:
environment: environment:
http_proxy: http_proxy:
https_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_CHECK_FUNCTION_CONTAINERS_HEALTHINESS: 'true'
NUCLIO_DASHBOARD_DEFAULT_FUNCTION_MOUNT_MODE: 'volume' NUCLIO_DASHBOARD_DEFAULT_FUNCTION_MOUNT_MODE: 'volume'
ports: ports:

@ -40,7 +40,7 @@ services:
CVAT_POSTGRES_HOST: 'cvat_db' CVAT_POSTGRES_HOST: 'cvat_db'
ADAPTIVE_AUTO_ANNOTATION: 'false' ADAPTIVE_AUTO_ANNOTATION: 'false'
IAM_OPA_BUNDLE: '1' IAM_OPA_BUNDLE: '1'
no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy} no_proxy: elasticsearch,kibana,logstash,nuclio,opa,${no_proxy:-}
NUMPROCS: 1 NUMPROCS: 1
USE_ALLAUTH_SOCIAL_ACCOUNTS: "" USE_ALLAUTH_SOCIAL_ACCOUNTS: ""
SOCIAL_AUTH_GOOGLE_CLIENT_ID: "" SOCIAL_AUTH_GOOGLE_CLIENT_ID: ""
@ -74,7 +74,7 @@ services:
environment: environment:
CVAT_REDIS_HOST: 'cvat_redis' CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db' 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 command: -c supervisord/utils.conf
volumes: volumes:
- cvat_data:/home/django/data - cvat_data:/home/django/data
@ -94,7 +94,7 @@ services:
environment: environment:
CVAT_REDIS_HOST: 'cvat_redis' CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db' 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 NUMPROCS: 2
command: -c supervisord/worker.default.conf command: -c supervisord/worker.default.conf
volumes: volumes:
@ -115,7 +115,7 @@ services:
environment: environment:
CVAT_REDIS_HOST: 'cvat_redis' CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db' 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 NUMPROCS: 1
command: -c supervisord/worker.low.conf command: -c supervisord/worker.low.conf
volumes: volumes:
@ -136,7 +136,7 @@ services:
environment: environment:
CVAT_REDIS_HOST: 'cvat_redis' CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db' 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 NUMPROCS: 1
command: -c supervisord/worker.webhooks.conf command: -c supervisord/worker.webhooks.conf
volumes: volumes:

@ -238,14 +238,13 @@ def start_services(rebuild=False):
docker_cp(CVAT_DB_DIR / "data.json", f"{PREFIX}_cvat_server_1:/tmp/data.json") docker_cp(CVAT_DB_DIR / "data.json", f"{PREFIX}_cvat_server_1:/tmp/data.json")
@pytest.fixture(autouse=True, scope="session") def pytest_sessionstart(session):
def services(request): stop = session.config.getoption("--stop-services")
stop = request.config.getoption("--stop-services") start = session.config.getoption("--start-services")
start = request.config.getoption("--start-services") rebuild = session.config.getoption("--rebuild")
rebuild = request.config.getoption("--rebuild") cleanup = session.config.getoption("--cleanup")
cleanup = request.config.getoption("--cleanup") dumpdb = session.config.getoption("--dumpdb")
dumpdb = request.config.getoption("--dumpdb") platform = session.config.getoption("--platform")
platform = request.config.getoption("--platform")
if platform == "kube" and any((stop, start, rebuild, cleanup, dumpdb)): if platform == "kube" and any((stop, start, rebuild, cleanup, dumpdb)):
raise Exception( raise Exception(
@ -297,11 +296,6 @@ def services(request):
if start: if start:
pytest.exit("All necessary containers have been created and started.", returncode=0) 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": elif platform == "kube":
kube_restore_data_volumes() kube_restore_data_volumes()
server_pod_name = _kube_get_server_pod_name() 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") @pytest.fixture(scope="function")

Loading…
Cancel
Save