graphql-engine/server/tests-py/queries/graphql_query/bigquery/replace_metadata.yaml
Abby Sassel 76c322589c server/bigquery: Document BigQuery integration tests
This PR documents & streamlines how we run BigQuery integration tests locally as a first step to [running them in CI](https://github.com/hasura/graphql-engine-mono/issues/1525).

I've also created a hasura service account for internal use. [Internal docs here](https://github.com/hasura/graphql-engine-mono/wiki/Testing-BigQuery).

Thanks to FP Complete team for [the guidance here](https://docs.google.com/document/d/1dGDK0touUtsDxRQPonMxSoPbIfzBoSYo02tAjQEO7qA/edit?ts=60c0cf24#), which I've reused parts of.

https://github.com/hasura/graphql-engine-mono/pull/1732

GitOrigin-RevId: 303819d212aa073fbef685d077b1cfa583cd15fc
2021-07-06 11:13:06 +00:00

138 lines
3.7 KiB
YAML

description: Replace schema cache (metadata)
url: /v1/metadata
status: 200
response:
message: success
query:
type: replace_metadata
args:
version: 3
sources:
- name: hasura_global_limited
kind: bigquery
configuration:
service_account: {from_env: HASURA_BIGQUERY_SERVICE_ACCOUNT}
project_id: {from_env: HASURA_BIGQUERY_PROJECT_ID}
datasets:
- hasura
global_select_limit: 1
tables:
- table:
name: LimitedAlbum
dataset: hasura
object_relationships:
- name: artist
using:
manual_configuration:
remote_table:
name: LimitedArtist
dataset: hasura
column_mapping:
artist_other_id: artist_self_id
- table:
name: LimitedArtist
dataset: hasura
array_relationships:
- name: albums
using:
manual_configuration:
remote_table:
name: LimitedAlbum
dataset: hasura
column_mapping:
artist_self_id: artist_other_id
- name: hasura
kind: bigquery
configuration:
service_account: {from_env: HASURA_BIGQUERY_SERVICE_ACCOUNT}
project_id: {from_env: HASURA_BIGQUERY_PROJECT_ID}
datasets:
- hasura
global_select_limit: 1000000
tables:
- table:
name: Album
dataset: hasura
object_relationships:
- name: artist
using:
manual_configuration:
remote_table:
name: Artist
dataset: hasura
column_mapping:
artist_other_id: artist_self_id
- table:
name: Artist
dataset: hasura
array_relationships:
- name: albums
using:
manual_configuration:
remote_table:
name: Album
dataset: hasura
column_mapping:
artist_self_id: artist_other_id
- table:
dataset: hasura
name: author
# is_enum: false
array_relationships:
- using:
manual_configuration:
remote_table:
name: article
dataset: hasura
column_mapping:
id: author_id
name: articles
- table:
dataset: hasura
name: article
# is_enum: false
object_relationships:
- using:
manual_configuration:
remote_table:
name: author
dataset: hasura
column_mapping:
author_id: id
name: author
select_permissions:
- role: published_only
permission:
columns: [is_published, id, title]
filter:
is_published: true
- role: exact_article_id
permission:
columns: [id, title, content]
filter:
id:
'_eq': 2
- role: empty_perms
permission:
columns: []
filter: {}
- role: user
permission:
columns: [id, title, content, author_id, is_published, published_on, created_at]
filter: {}
- role: test_timestamp_perm
permission:
columns: [id, title, content]
filter:
created_at:
'_eq': '2008-12-25T07:30:02'
- table:
dataset: hasura
name: all_types
# is_enum: false
inherited_roles:
- role_name: user_anonymous_test_inherited_role
role_set: ["user", "anonymous", "test", "anonymous2"]