diff --git a/test/api/query/snapshots/snap_test_entities.py b/test/api/query/snapshots/snap_test_entities.py index 98fd0c3a..40108c18 100644 --- a/test/api/query/snapshots/snap_test_entities.py +++ b/test/api/query/snapshots/snap_test_entities.py @@ -9,82 +9,170 @@ snapshots['test_all 1'] = { 'data': { - 'allEntities': None - }, - 'errors': [ - { - 'locations': [ + 'allEntities': { + 'edges': [ { - 'column': 7, - 'line': 3 + 'node': { + 'description': 'This is my fancy component', + 'id': 'RW50aXR5OjE=', + 'kind': None, + 'label': 'Base', + 'name': 'base', + 'owner': 'platform', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 2', + 'id': 'RW50aXR5OjI=', + 'kind': None, + 'label': 'Base 2', + 'name': 'base_2', + 'owner': 'platformm2', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 3', + 'id': 'RW50aXR5OjMy', + 'kind': None, + 'label': 'Base 3', + 'name': 'base_3', + 'owner': 'platformm3', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy service', + 'id': 'RW50aXR5OjEyNDU=', + 'kind': None, + 'label': 'Service', + 'name': 'service', + 'owner': 'platform', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy library', + 'id': 'RW50aXR5OjE1NTQ1', + 'kind': None, + 'label': 'Library', + 'name': 'library', + 'owner': 'platform', + 'type': None + } } ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', - 'path': [ - 'allEntities' - ] + 'pageInfo': { + 'endCursor': 'NQ==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' + }, + 'totalCount': 5 } - ] + } } snapshots['test_empty 1'] = { 'data': { - 'allEntities': None - }, - 'errors': [ - { - 'locations': [ - { - 'column': 7, - 'line': 3 - } + 'allEntities': { + 'edges': [ ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', - 'path': [ - 'allEntities' - ] + 'totalCount': 0 } - ] + } } snapshots['test_first 1'] = { 'data': { - 'allEntities': None - }, - 'errors': [ - { - 'locations': [ + 'allEntities': { + 'edges': [ { - 'column': 7, - 'line': 3 + 'node': { + 'description': 'This is my fancy component', + 'id': 'RW50aXR5OjE=', + 'kind': None, + 'label': 'Base', + 'name': 'base', + 'owner': 'platform', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 2', + 'id': 'RW50aXR5OjI=', + 'kind': None, + 'label': 'Base 2', + 'name': 'base_2', + 'owner': 'platformm2', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 3', + 'id': 'RW50aXR5OjMy', + 'kind': None, + 'label': 'Base 3', + 'name': 'base_3', + 'owner': 'platformm3', + 'type': None + } } ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', - 'path': [ - 'allEntities' - ] + 'pageInfo': { + 'endCursor': 'Mw==', + 'hasNextPage': True, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' + }, + 'totalCount': 5 } - ] + } } snapshots['test_first_after 1'] = { 'data': { - 'allEntities': None - }, - 'errors': [ - { - 'locations': [ + 'allEntities': { + 'edges': [ { - 'column': 7, - 'line': 3 + 'node': { + 'description': 'This is my fancy component 2', + 'id': 'RW50aXR5OjI=', + 'kind': None, + 'label': 'Base 2', + 'name': 'base_2', + 'owner': 'platformm2', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 3', + 'id': 'RW50aXR5OjMy', + 'kind': None, + 'label': 'Base 3', + 'name': 'base_3', + 'owner': 'platformm3', + 'type': None + } } ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', - 'path': [ - 'allEntities' - ] + 'pageInfo': { + 'endCursor': 'Mw==', + 'hasNextPage': True, + 'hasPreviousPage': True, + 'startCursor': 'Mg==' + }, + 'totalCount': 5 } - ] + } } snapshots['test_last 1'] = { @@ -99,7 +187,7 @@ 'line': 3 } ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', + 'message': 'Pagination "last" works only in combination with "before" argument.', 'path': [ 'allEntities' ] @@ -109,120 +197,502 @@ snapshots['test_last_before 1'] = { 'data': { - 'allEntities': None - }, - 'errors': [ - { - 'locations': [ - { - 'column': 7, - 'line': 3 - } + 'allEntities': { + 'edges': [ ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', - 'path': [ - 'allEntities' - ] + 'pageInfo': { + 'endCursor': None, + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': None + }, + 'totalCount': 5 } - ] + } } snapshots['test_with_group 1'] = { 'data': { - 'allEntities': None - }, - 'errors': [ - { - 'locations': [ + 'allEntities': { + 'edges': [ { - 'column': 7, - 'line': 3 + 'node': { + 'description': 'This is my fancy component', + 'group': { + 'maintainers': [ + ], + 'productOwner': 'wallacebrian', + 'projectOwner': 'ktorres' + }, + 'id': 'RW50aXR5OjE=', + 'kind': None, + 'label': 'Base', + 'name': 'base', + 'owner': 'platform', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 2', + 'group': { + 'maintainers': [ + ], + 'productOwner': 'twatson', + 'projectOwner': 'cartermatthew' + }, + 'id': 'RW50aXR5OjI=', + 'kind': None, + 'label': 'Base 2', + 'name': 'base_2', + 'owner': 'platformm2', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 3', + 'group': { + 'maintainers': [ + ], + 'productOwner': 'jason33', + 'projectOwner': 'gomezjonathan' + }, + 'id': 'RW50aXR5OjMy', + 'kind': None, + 'label': 'Base 3', + 'name': 'base_3', + 'owner': 'platformm3', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy service', + 'group': { + 'maintainers': [ + ], + 'productOwner': 'jeffrey52', + 'projectOwner': 'kari29' + }, + 'id': 'RW50aXR5OjEyNDU=', + 'kind': None, + 'label': 'Service', + 'name': 'service', + 'owner': 'platform', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy library', + 'group': { + 'maintainers': [ + ], + 'productOwner': 'vmelendez', + 'projectOwner': 'wrivera' + }, + 'id': 'RW50aXR5OjE1NTQ1', + 'kind': None, + 'label': 'Library', + 'name': 'library', + 'owner': 'platform', + 'type': None + } } ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', - 'path': [ - 'allEntities' - ] + 'pageInfo': { + 'endCursor': 'NQ==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' + }, + 'totalCount': 5 } - ] + } } snapshots['test_with_library 1'] = { 'data': { - 'allEntities': None - }, - 'errors': [ - { - 'locations': [ + 'allEntities': { + 'edges': [ { - 'column': 7, - 'line': 3 + 'node': { + 'description': 'This is my fancy component', + 'id': 'RW50aXR5OjE=', + 'kind': None, + 'label': 'Base', + 'library': None, + 'name': 'base', + 'owner': 'platform', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 2', + 'id': 'RW50aXR5OjI=', + 'kind': None, + 'label': 'Base 2', + 'library': None, + 'name': 'base_2', + 'owner': 'platformm2', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 3', + 'id': 'RW50aXR5OjMy', + 'kind': None, + 'label': 'Base 3', + 'library': None, + 'name': 'base_3', + 'owner': 'platformm3', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy service', + 'id': 'RW50aXR5OjEyNDU=', + 'kind': None, + 'label': 'Service', + 'library': None, + 'name': 'service', + 'owner': 'platform', + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy library', + 'id': 'RW50aXR5OjE1NTQ1', + 'kind': None, + 'label': 'Library', + 'library': { + 'docsUrl': None, + 'impact': 'employees', + 'libraryUrl': None, + 'lifecycle': 'beta', + 'name': 'clark', + 'owner': 'carolyn61', + 'slackChannel': 'lewis', + 'sonarqubeProject': 'lin' + }, + 'name': 'library', + 'owner': 'platform', + 'type': None + } } ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', - 'path': [ - 'allEntities' - ] + 'pageInfo': { + 'endCursor': 'NQ==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' + }, + 'totalCount': 5 } - ] + } } snapshots['test_with_links 1'] = { 'data': { - 'allEntities': None - }, - 'errors': [ - { - 'locations': [ + 'allEntities': { + 'edges': [ { - 'column': 7, - 'line': 3 + 'node': { + 'allLinks': { + 'edges': [ + { + 'node': { + 'icon': 'poop', + 'name': 'Datadog', + 'url': 'https://dashboard.datadog.com' + } + } + ], + 'pageInfo': { + 'endCursor': 'MQ==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' + }, + 'totalCount': 1 + }, + 'description': 'This is my fancy component', + 'id': 'RW50aXR5OjE=', + 'kind': None, + 'label': 'Base', + 'name': 'base', + 'owner': 'platform', + 'type': None + } + }, + { + 'node': { + 'allLinks': { + 'edges': [ + { + 'node': { + 'icon': None, + 'name': 'Sentry', + 'url': 'https://sentry.skypicker.com' + } + } + ], + 'pageInfo': { + 'endCursor': 'MQ==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' + }, + 'totalCount': 1 + }, + 'description': 'This is my fancy component 2', + 'id': 'RW50aXR5OjI=', + 'kind': None, + 'label': 'Base 2', + 'name': 'base_2', + 'owner': 'platformm2', + 'type': None + } + }, + { + 'node': { + 'allLinks': { + 'edges': [ + ], + 'pageInfo': { + 'endCursor': None, + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': None + }, + 'totalCount': 0 + }, + 'description': 'This is my fancy component 3', + 'id': 'RW50aXR5OjMy', + 'kind': None, + 'label': 'Base 3', + 'name': 'base_3', + 'owner': 'platformm3', + 'type': None + } + }, + { + 'node': { + 'allLinks': { + 'edges': [ + ], + 'pageInfo': { + 'endCursor': None, + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': None + }, + 'totalCount': 0 + }, + 'description': 'This is my fancy service', + 'id': 'RW50aXR5OjEyNDU=', + 'kind': None, + 'label': 'Service', + 'name': 'service', + 'owner': 'platform', + 'type': None + } + }, + { + 'node': { + 'allLinks': { + 'edges': [ + ], + 'pageInfo': { + 'endCursor': None, + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': None + }, + 'totalCount': 0 + }, + 'description': 'This is my fancy library', + 'id': 'RW50aXR5OjE1NTQ1', + 'kind': None, + 'label': 'Library', + 'name': 'library', + 'owner': 'platform', + 'type': None + } } ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', - 'path': [ - 'allEntities' - ] + 'pageInfo': { + 'endCursor': 'NQ==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' + }, + 'totalCount': 5 } - ] + } } snapshots['test_with_service 1'] = { 'data': { - 'allEntities': None - }, - 'errors': [ - { - 'locations': [ + 'allEntities': { + 'edges': [ { - 'column': 7, - 'line': 3 + 'node': { + 'description': 'This is my fancy component', + 'id': 'RW50aXR5OjE=', + 'kind': None, + 'label': 'Base', + 'name': 'base', + 'owner': 'platform', + 'service': None, + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 2', + 'id': 'RW50aXR5OjI=', + 'kind': None, + 'label': 'Base 2', + 'name': 'base_2', + 'owner': 'platformm2', + 'service': None, + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 3', + 'id': 'RW50aXR5OjMy', + 'kind': None, + 'label': 'Base 3', + 'name': 'base_3', + 'owner': 'platformm3', + 'service': None, + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy service', + 'id': 'RW50aXR5OjEyNDU=', + 'kind': None, + 'label': 'Service', + 'name': 'service', + 'owner': 'platform', + 'service': { + 'docsUrl': 'https://docs.com', + 'id': 'U2VydmljZToz', + 'impact': 'employees', + 'lifecycle': 'production', + 'owner': 'platform', + 'pagerdutyService': None, + 'slackChannel': '#platform-software' + }, + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy library', + 'id': 'RW50aXR5OjE1NTQ1', + 'kind': None, + 'label': 'Library', + 'name': 'library', + 'owner': 'platform', + 'service': None, + 'type': None + } } ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', - 'path': [ - 'allEntities' - ] + 'pageInfo': { + 'endCursor': 'NQ==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' + }, + 'totalCount': 5 } - ] + } } snapshots['test_with_source 1'] = { 'data': { - 'allEntities': None - }, - 'errors': [ - { - 'locations': [ + 'allEntities': { + 'edges': [ { - 'column': 7, - 'line': 3 + 'node': { + 'description': 'This is my fancy component', + 'id': 'RW50aXR5OjE=', + 'kind': None, + 'label': 'Base', + 'name': 'base', + 'owner': 'platform', + 'source': None, + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 2', + 'id': 'RW50aXR5OjI=', + 'kind': None, + 'label': 'Base 2', + 'name': 'base_2', + 'owner': 'platformm2', + 'source': None, + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy component 3', + 'id': 'RW50aXR5OjMy', + 'kind': None, + 'label': 'Base 3', + 'name': 'base_3', + 'owner': 'platformm3', + 'source': None, + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy service', + 'id': 'RW50aXR5OjEyNDU=', + 'kind': None, + 'label': 'Service', + 'name': 'service', + 'owner': 'platform', + 'source': None, + 'type': None + } + }, + { + 'node': { + 'description': 'This is my fancy library', + 'id': 'RW50aXR5OjE1NTQ1', + 'kind': None, + 'label': 'Library', + 'name': 'library', + 'owner': 'platform', + 'source': None, + 'type': None + } } ], - 'message': 'Resolved value from the connection field have to be iterable or instance of EntityConnection. Received "None"', - 'path': [ - 'allEntities' - ] + 'pageInfo': { + 'endCursor': 'NQ==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' + }, + 'totalCount': 5 } - ] + } } diff --git a/test/api/query/snapshots/snap_test_links.py b/test/api/query/snapshots/snap_test_links.py index 1008655a..feaea2c5 100644 --- a/test/api/query/snapshots/snap_test_links.py +++ b/test/api/query/snapshots/snap_test_links.py @@ -16,28 +16,7 @@ 'icon': 'smile', 'id': 'TGluazox', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -45,28 +24,7 @@ 'icon': 'smile', 'id': 'TGluazoy', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -74,28 +32,7 @@ 'icon': 'smile', 'id': 'TGluazoz', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -103,28 +40,7 @@ 'icon': 'smile', 'id': 'TGluazo0', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -132,28 +48,7 @@ 'icon': 'smile', 'id': 'TGluazo1', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } } ], @@ -187,28 +82,7 @@ 'icon': 'smile', 'id': 'TGluazox', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -216,28 +90,7 @@ 'icon': 'smile', 'id': 'TGluazoy', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -245,28 +98,7 @@ 'icon': 'smile', 'id': 'TGluazoz', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } } ], @@ -290,28 +122,7 @@ 'icon': 'smile', 'id': 'TGluazoy', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -319,28 +130,7 @@ 'icon': 'smile', 'id': 'TGluazoz', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } } ], @@ -408,28 +198,7 @@ 'icon': 'smile', 'id': 'TGluazox', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -445,28 +214,7 @@ 'icon': 'smile', 'id': 'TGluazoy', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -482,28 +230,7 @@ 'icon': 'smile', 'id': 'TGluazoz', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -519,28 +246,7 @@ 'icon': 'smile', 'id': 'TGluazo0', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } }, { @@ -556,28 +262,7 @@ 'icon': 'smile', 'id': 'TGluazo1', 'name': 'link', - 'url': [ - 'h', - 't', - 't', - 'p', - 's', - ':', - '/', - '/', - 's', - 'o', - 'm', - 'e', - '.', - 'u', - 'r', - 'l', - '.', - 'c', - 'o', - 'm' - ] + 'url': 'https://some.url.com' } } ], diff --git a/test/api/query/test_entities.py b/test/api/query/test_entities.py index 2a6347a4..1b0d385d 100644 --- a/test/api/query/test_entities.py +++ b/test/api/query/test_entities.py @@ -258,6 +258,7 @@ def test_with_group(snapshot, call_api, generate_components): owner description group { + id productOwner projectOwner maintainers @@ -292,6 +293,7 @@ def test_with_library(snapshot, call_api, generate_components): owner description library { + id owner name lifecycle