mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
7f1f0606ed
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10528 Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com> GitOrigin-RevId: 49d0d7cbcc73fb0876d7ac3f5a1a8ff61ff800e8
44 lines
1.4 KiB
Python
44 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
|
|
import pytest
|
|
|
|
from conftest import extract_server_address_from
|
|
from remote_server import NodeGraphQL
|
|
from validate import check_query_f
|
|
|
|
pytestmark = [
|
|
pytest.mark.admin_secret,
|
|
]
|
|
|
|
@pytest.fixture(scope='class')
|
|
@pytest.mark.early
|
|
def fake_graphql_service(worker_id: str, hge_fixture_env: dict[str, str]):
|
|
(_, port) = extract_server_address_from('GRAPHQL_SERVICE')
|
|
server = NodeGraphQL(worker_id, 'remote_schemas/nodejs/returns_data_and_errors.js', port=port)
|
|
server.start()
|
|
print(f'{fake_graphql_service.__name__} server started on {server.url}')
|
|
hge_fixture_env['GRAPHQL_SERVICE'] = server.url
|
|
yield server
|
|
server.stop()
|
|
|
|
use_test_fixtures = pytest.mark.usefixtures(
|
|
'fake_graphql_service',
|
|
'per_method_tests_db_state',
|
|
)
|
|
|
|
@use_test_fixtures
|
|
class TestRemoteSchemaPrioritizeErrors:
|
|
|
|
@classmethod
|
|
def dir(cls):
|
|
return "queries/remote_schemas/validate_data_errors_prioritization/"
|
|
|
|
def test_data_only_query(self, hge_ctx):
|
|
check_query_f(hge_ctx, self.dir() + 'no_prioritization/test_data_only_query.yaml')
|
|
|
|
def test_error_only_query(self, hge_ctx):
|
|
check_query_f(hge_ctx, self.dir() + 'no_prioritization/test_error_only_query.yaml')
|
|
|
|
def test_data_and_errors_query(self, hge_ctx):
|
|
check_query_f(hge_ctx, self.dir() + 'no_prioritization/test_data_and_errors_query.yaml')
|