Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport V5 test system to V4 #794

Merged
merged 91 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
fce88a9
Backport V5 test system to V4
benjie May 24, 2022
24d0821
Format SQL
benjie May 24, 2022
6bdb452
Allow passing configuration via tests
benjie May 24, 2022
2f07c9c
Expand test compatibility
benjie May 24, 2022
0a083b2
badlyBehavedFunction
jemgillam May 25, 2022
aa0a067
classic-ids
jemgillam May 25, 2022
f8a38d5
connections-order-computed-column
jemgillam May 25, 2022
9391d95
connections-totalCount
jemgillam May 25, 2022
929e598
connections test
jemgillam May 25, 2022
27128c2
d.filter
jemgillam May 25, 2022
e068f93
d.order
jemgillam May 25, 2022
0684685
directives
jemgillam May 25, 2022
995bb66
dynamic-json.condition-json-field-variable
jemgillam May 25, 2022
5dc1920
dynamic-json
jemgillam May 25, 2022
d85f122
empty array
jemgillam May 25, 2022
f56f714
enum tables
jemgillam May 25, 2022
80b7747
JWT support
benjie May 25, 2022
c6e7c9a
JWT test
benjie May 25, 2022
27d6ec3
JWT big numbers
benjie May 25, 2022
eea153d
JWT test fail
benjie May 25, 2022
52ea205
Another JWT test
benjie May 25, 2022
88cde63
Another JWT test
benjie May 25, 2022
e805f1a
JWT examples are mutations
benjie May 25, 2022
abe4782
Remove variables from ranges test
benjie May 25, 2022
7b14be1
Add ranges tests
benjie May 25, 2022
24708ae
Node v8 support in tests
benjie May 25, 2022
2365b12
Fix mutations _test
benjie May 25, 2022
18103b5
Remove 'on conflict' for PG 9.4 compat
benjie May 25, 2022
f076493
Split makeSchema to its own function
benjie May 26, 2022
8ae718b
Refactor test helpers and add schema test
benjie May 26, 2022
18f81f8
enums 2
jemgillam May 25, 2022
dae30cd
function-return-types
jemgillam May 25, 2022
cc066f1
json overflow
jemgillam May 25, 2022
3f72de4
bigint
jemgillam May 26, 2022
75168f3
longAliases
jemgillam May 26, 2022
c889478
geometry and named_query
jemgillam May 26, 2022
c804b08
network_types
jemgillam May 26, 2022
0ab9c58
node test
jemgillam May 26, 2022
35b7a81
nonexistant-record
jemgillam May 27, 2022
225814f
one-to-one-backward
jemgillam May 27, 2022
e3c57ea
orderByNulls
jemgillam May 27, 2022
3397e10
pg11 network types
jemgillam May 27, 2022
3a9ebcf
pg11 types
jemgillam May 27, 2022
9199070
posts test
jemgillam May 27, 2022
6de4c93
procedure-computed-fields
jemgillam May 27, 2022
e24e5cd
procedure-query
jemgillam May 27, 2022
e060d59
rbac basic
jemgillam May 27, 2022
16e09a9
relation-head-tail
jemgillam May 27, 2022
676870e
relation-tail-head
jemgillam May 27, 2022
6b7870d
simple-collections
jemgillam May 27, 2022
9163a7d
Skip tests on incompatible PG versions
benjie May 27, 2022
1fefac9
Fix test skipping
benjie May 27, 2022
aebcf2b
JSON overflow test requires PG9.5
benjie May 27, 2022
d582d98
Consistent ordering on friends
benjie May 27, 2022
9457743
simple-proc-computed-fields
jemgillam May 30, 2022
1c1da54
simple-pro-query
jemgillam May 30, 2022
3e296de
simple-relations-head-tail
jemgillam May 30, 2022
48b4e79
smart-comment-relations
jemgillam May 30, 2022
4f305dc
simple-relations-tail-head
jemgillam May 30, 2022
cbd1f24
types
jemgillam May 30, 2022
b3dafdc
unique-contraints
jemgillam May 30, 2022
c9a7cc6
unique-fkeys
jemgillam May 30, 2022
2ea656e
view test
jemgillam May 30, 2022
c3ed431
Useful comments
jemgillam May 31, 2022
d4ba915
d.createPerson
jemgillam May 31, 2022
18b184d
Kitchen sink stability
benjie May 31, 2022
c8e4a76
d.deletePerson
jemgillam May 31, 2022
48475d1
d.updatePerson
jemgillam May 31, 2022
1243b2d
enum tables mutations
jemgillam May 31, 2022
eea712e
enum tables mutations2
jemgillam May 31, 2022
c1b19a6
geometry mutations
jemgillam May 31, 2022
b4443d0
inheritence.createUserFile
jemgillam May 31, 2022
03c2989
mutation-create
jemgillam May 31, 2022
56831f1
mutation-delete tests
jemgillam Jul 5, 2022
70016f2
Add missing unique constraint
benjie Jul 4, 2022
a19990a
mutation-return-types
jemgillam Jul 5, 2022
576ab76
mutation-update
jemgillam Jul 5, 2022
aec6edb
network_types
jemgillam Jul 5, 2022
b8e0dd8
pg11 identity
jemgillam Jul 5, 2022
ad468fe
pg11 network types createNetwork
jemgillam Jul 5, 2022
24971e1
pg11 types
jemgillam Jul 5, 2022
78108e2
procedure mutation
jemgillam Jul 5, 2022
76ad075
rbac.create
jemgillam Jul 5, 2022
9b088bd
rbac.createPerson
jemgillam Jul 5, 2022
e0596ac
rbac.deletePerson
jemgillam Jul 6, 2022
7bb75ca
rbac.leftArmIdentity
jemgillam Jul 6, 2022
fa898d3
rbac.updateLeftArm
jemgillam Jul 6, 2022
8822b6a
rbac.updatePerson
jemgillam Jul 6, 2022
edbfd98
types test
jemgillam Jul 6, 2022
e948683
Explicit stable ordering
benjie Jul 7, 2022
7ac2a2e
Restart sequences
benjie Aug 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Expand test compatibility
  • Loading branch information
benjie committed May 24, 2022
commit 2f07c9ca7afb44905dc057937234849cc71c06fc
1 change: 0 additions & 1 deletion packages/postgraphile-core/__tests__/helpers-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ export async function runTestQuery(
} finally {
//eslint-disable-next-line require-atomic-updates
pgClient.query = oldQuery;
await pgClient.query("rollback to savepoint test");
}
});
}
Expand Down
28 changes: 20 additions & 8 deletions packages/postgraphile-core/__tests__/queries/_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,17 @@ exports.assertSnapshotsMatch = assertSnapshotsMatch;
exports.runTestQuery = async (source, config, options) => {
const schema = await withPgClient(async pgClient => {
// A selection of omit/rename comments on the d schema
const serverVersionNum = await getServerVersionNum(pgClient);
if (serverVersionNum < 110000 && config.pg11) {
return null;
}

await pgClient.query(await dSchemaComments());

if (config.ignoreRBAC === false) {
await pgClient.query("set role postgraphile_test_authenticator");
}

return createPostGraphileSchema(
pgClient,
config.schema ?? ["a", "b", "c"],
Expand All @@ -60,27 +70,29 @@ exports.runTestQuery = async (source, config, options) => {
setofFunctionsContainNulls: config.setofFunctionsContainNulls,
simpleCollections: config.simpleCollections,
graphileBuildOptions: config.graphileBuildOptions,
ignoreRBAC: config.ignoreRBAC,
appendPlugins: [
ExtendedPlugin,
config.ToyCategoriesPlugin ? ToyCategoriesPlugin : null,
].filter(isNotNullish),
}
);
});
if (!schema) {
return null;
}
const onConnect = async pgClient => {
// Add data to the client instance we are using.
// Load test data
await pgClient.query(await kitchenSinkData());
const serverVersionNum = await getServerVersionNum(pgClient);
if (serverVersionNum >= 110000) {
await pgClient.query(await pg11Data());
}
const contextValue = {};
await pgClient.query("savepoint test");
// if (gqlSchema === gqlSchemas.rbac) {
// await pgClient.query(
// "select set_config('role', 'postgraphile_test_visitor', true), set_config('jwt.claims.user_id', '3', true)"
// );
// }
if (config.ignoreRBAC === false) {
await pgClient.query(
"select set_config('role', 'postgraphile_test_visitor', true), set_config('jwt.claims.user_id', '3', true)"
);
}
};
return runTestQuery(schema, source, config, {
...options,
Expand Down