mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-12 19:27:09 +00:00
35 lines
990 B
Python
35 lines
990 B
Python
![]() |
import time
|
||
|
|
||
|
import pytest
|
||
|
import requests
|
||
|
import urllib
|
||
|
from datahub.cli.docker import check_local_docker_containers
|
||
|
from datahub.ingestion.run.pipeline import Pipeline
|
||
|
from tests.utils import FRONTEND_ENDPOINT
|
||
|
|
||
|
@pytest.fixture(scope="session")
|
||
|
def wait_for_healthchecks():
|
||
|
# Simply assert that everything is healthy, but don't wait.
|
||
|
assert not check_local_docker_containers()
|
||
|
yield
|
||
|
|
||
|
@pytest.fixture(scope="session")
|
||
|
def frontend_session(wait_for_healthchecks):
|
||
|
session = requests.Session()
|
||
|
|
||
|
headers = {
|
||
|
"Content-Type": "application/json",
|
||
|
}
|
||
|
data = '{"username":"datahub", "password":"datahub"}'
|
||
|
response = session.post(
|
||
|
f"{FRONTEND_ENDPOINT}/logIn", headers=headers, data=data
|
||
|
)
|
||
|
response.raise_for_status()
|
||
|
|
||
|
yield session
|
||
|
|
||
|
# TODO: Determine whether we need this or not.
|
||
|
@pytest.mark.dependency()
|
||
|
def test_healthchecks(wait_for_healthchecks):
|
||
|
# Call to wait_for_healthchecks fixture will do the actual functionality.
|
||
|
pass
|