|
1 | | -from functools import partial |
| 1 | +# from functools import partial |
2 | 2 |
|
3 | | -import pytest |
4 | | -from aiohttp import ClientResponse |
5 | | -from api_test_utils.api_session_client import APISessionClient |
6 | | -from api_test_utils.api_test_session_config import APITestSessionConfig |
7 | | -from api_test_utils import poll_until, env |
| 3 | +# import pytest |
| 4 | +# from aiohttp import ClientResponse |
| 5 | +# from api_test_utils.api_session_client import APISessionClient |
| 6 | +# from api_test_utils.api_test_session_config import APITestSessionConfig |
| 7 | +# from api_test_utils import poll_until, env |
8 | 8 |
|
9 | 9 |
|
10 | | -async def _is_deployed(resp: ClientResponse, api_test_config: APITestSessionConfig) -> bool: |
| 10 | +# async def _is_deployed(resp: ClientResponse, api_test_config: APITestSessionConfig) -> bool: |
11 | 11 |
|
12 | | - if resp.status != 200: |
13 | | - return False |
14 | | - body = await resp.json() |
| 12 | +# if resp.status != 200: |
| 13 | +# return False |
| 14 | +# body = await resp.json() |
15 | 15 |
|
16 | | - return body.get("commitId") == api_test_config.commit_id |
| 16 | +# return body.get("commitId") == api_test_config.commit_id |
17 | 17 |
|
18 | 18 |
|
19 | | -async def is_401(resp: ClientResponse) -> bool: |
20 | | - return resp.status == 401 |
| 19 | +# async def is_401(resp: ClientResponse) -> bool: |
| 20 | +# return resp.status == 401 |
21 | 21 |
|
22 | 22 |
|
23 | | -@pytest.mark.e2e |
24 | | -@pytest.mark.smoketest |
25 | | -def test_output_test_config(api_test_config: APITestSessionConfig): |
26 | | - print(api_test_config) |
| 23 | +# @pytest.mark.e2e |
| 24 | +# @pytest.mark.smoketest |
| 25 | +# def test_output_test_config(api_test_config: APITestSessionConfig): |
| 26 | +# print(api_test_config) |
27 | 27 |
|
28 | 28 |
|
29 | | -@pytest.mark.e2e |
30 | | -@pytest.mark.smoketest |
31 | | -@pytest.mark.asyncio |
32 | | -async def test_wait_for_ping(api_client: APISessionClient, api_test_config: APITestSessionConfig): |
33 | | - """ |
34 | | - test for _ping .. this uses poll_until to wait until the correct SOURCE_COMMIT_ID ( from env var ) |
35 | | - is available |
36 | | - """ |
| 29 | +# @pytest.mark.e2e |
| 30 | +# @pytest.mark.smoketest |
| 31 | +# @pytest.mark.asyncio |
| 32 | +# async def test_wait_for_ping(api_client: APISessionClient, api_test_config: APITestSessionConfig): |
| 33 | +# """ |
| 34 | +# test for _ping .. this uses poll_until to wait until the correct SOURCE_COMMIT_ID ( from env var ) |
| 35 | +# is available |
| 36 | +# """ |
37 | 37 |
|
38 | | - is_deployed = partial(_is_deployed, api_test_config=api_test_config) |
| 38 | +# is_deployed = partial(_is_deployed, api_test_config=api_test_config) |
39 | 39 |
|
40 | | - await poll_until( |
41 | | - make_request=lambda: api_client.get('_ping'), |
42 | | - until=is_deployed, |
43 | | - timeout=120 |
44 | | - ) |
| 40 | +# await poll_until( |
| 41 | +# make_request=lambda: api_client.get('_ping'), |
| 42 | +# until=is_deployed, |
| 43 | +# timeout=120 |
| 44 | +# ) |
45 | 45 |
|
46 | 46 |
|
47 | | -@pytest.mark.e2e |
48 | | -@pytest.mark.smoketest |
49 | | -@pytest.mark.asyncio |
50 | | -async def test_check_status_is_secured(api_client: APISessionClient): |
| 47 | +# @pytest.mark.e2e |
| 48 | +# @pytest.mark.smoketest |
| 49 | +# @pytest.mark.asyncio |
| 50 | +# async def test_check_status_is_secured(api_client: APISessionClient): |
51 | 51 |
|
52 | | - await poll_until( |
53 | | - make_request=lambda: api_client.get('_status'), |
54 | | - until=is_401, |
55 | | - timeout=120 |
56 | | - ) |
| 52 | +# await poll_until( |
| 53 | +# make_request=lambda: api_client.get('_status'), |
| 54 | +# until=is_401, |
| 55 | +# timeout=120 |
| 56 | +# ) |
57 | 57 |
|
58 | 58 |
|
59 | | -@pytest.mark.e2e |
60 | | -@pytest.mark.smoketest |
61 | | -@pytest.mark.asyncio |
62 | | -async def test_wait_for_status(api_client: APISessionClient, api_test_config: APITestSessionConfig): |
| 59 | +# @pytest.mark.e2e |
| 60 | +# @pytest.mark.smoketest |
| 61 | +# @pytest.mark.asyncio |
| 62 | +# async def test_wait_for_status(api_client: APISessionClient, api_test_config: APITestSessionConfig): |
63 | 63 |
|
64 | | - """ |
65 | | - test for _status .. this uses poll_until to wait until the correct SOURCE_COMMIT_ID ( from env var ) |
66 | | - is available |
67 | | - """ |
| 64 | +# """ |
| 65 | +# test for _status .. this uses poll_until to wait until the correct SOURCE_COMMIT_ID ( from env var ) |
| 66 | +# is available |
| 67 | +# """ |
68 | 68 |
|
69 | | - is_deployed = partial(_is_deployed, api_test_config=api_test_config) |
| 69 | +# is_deployed = partial(_is_deployed, api_test_config=api_test_config) |
70 | 70 |
|
71 | | - await poll_until( |
72 | | - make_request=lambda: api_client.get('_status', headers={'apikey': env.status_endpoint_api_key()}), |
73 | | - until=is_deployed, |
74 | | - timeout=120 |
75 | | - ) |
| 71 | +# await poll_until( |
| 72 | +# make_request=lambda: api_client.get('_status', headers={'apikey': env.status_endpoint_api_key()}), |
| 73 | +# until=is_deployed, |
| 74 | +# timeout=120 |
| 75 | +# ) |
0 commit comments