graphql-engine/server/tests-py/queries/inconsistent_objects/test.yaml
Rakesh Emmadi 421a182f64 export metadata without nulls, empty arrays & default values (#3393)
* export metadata without nulls, empty arrays
* property tests for 'ReplaceMetadata' using QuickCheck
-> Derive Arbitrary class for 'ReplaceMetadata' dependant types

* reduce property test cases number to 30
QuickCheck generates the `ReplaceMetadata` value really large
for higher number test cases. Encoded JSON for such values is large and
consumes more memory. Thus, CI is giving up while running property
tests.

* circle-ci: Add property tests as saperate job
* add no command mode to tests
* add yaml.v2 to go mod
* remove indirect comment for yaml.v2 dependency
2019-12-14 00:47:38 -06:00

88 lines
1.7 KiB
YAML

# Setup
setup:
type: bulk
args:
# tables
- type: run_sql
args:
sql: |
create table author(
id serial primary key,
name text unique
);
create table article(
id serial primary key,
title text not null,
content text,
author_id integer not null references author(id)
);
- type: track_table
args:
schema: public
name: author
- type: track_table
args:
schema: public
name: article
#Object relationship
- type: create_object_relationship
args:
table: article
name: author
using:
foreign_key_constraint_on: author_id
#Array relationship
- type: create_array_relationship
args:
table: author
name: articles
using:
foreign_key_constraint_on:
table: article
column: author_id
#SQL to cause inconsistentancy
sql: drop table article;
# Inconsistent objects to be returned
inconsistent_objects:
- definition:
using:
foreign_key_constraint_on:
column: author_id
table:
schema: public
name: article
name: articles
comment:
table:
schema: public
name: author
reason: table "article" does not exist
type: array_relation
- definition:
using:
foreign_key_constraint_on: author_id
name: author
comment:
table:
schema: public
name: article
reason: table "article" does not exist
type: object_relation
- definition:
schema: public
name: article
reason: 'no such table/view exists in postgres: "article"'
type: table
# Teardown
teardown:
type: bulk
args:
- type: run_sql
args:
sql: |
drop table author