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

Add tap tests on pgsodium objects schema #67

Merged
merged 12 commits into from
Jan 30, 2023
Merged

Conversation

ioguix
Copy link
Collaborator

@ioguix ioguix commented Jan 6, 2023

This adds tap tests on the pgsodium extension itself. This should help enforce some sanity rules about ownership, privileges, existing objects, etc.

This is currently a draft as:

  • it has been generated by the pgsodium_tapgen.pl perl script and needs some detailed review.
  • it still requires some more tests

The generation script itself is included in this PR for information only. The objective is to edit the pgsodium_schema.sql test script bu hand.

@ioguix
Copy link
Collaborator Author

ioguix commented Jan 6, 2023

Note that the tests are currently failing because of #68

@ioguix ioguix force-pushed the schema_tests branch 2 times, most recently from 8dadb20 to 727e10c Compare January 10, 2023 21:59
This makes any change easier to spot
Adding checks for: language, return type, volatility, strictiness,
security definer and function kind.
@ioguix
Copy link
Collaborator Author

ioguix commented Jan 17, 2023

Hi,

There's currently 1729 tests including the ones from commit f64f2cf.

We could add some more tests around indexes & constraints on table keys and about the event trigger (not supported by pgtap yet).

From here, I'll need some serious review, the next steps would be to:

  • check all owners, privs, strictiness, security definers and so on
  • fix them in the tests (turns the tests red)
  • fix them in the code (turns the tests green)

Regards,

@ioguix ioguix changed the title [draft] Add tap tests on pgsodium objects schema Add tap tests on pgsodium objects schema Jan 26, 2023
Copy link
Owner

@michelp michelp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is huge! Thanks so much for this work. I went through it as much as I could, and I'm happy with "freezing" the interface contract to this test spec going forward. As the package evolves we'll be careful to make sure the contract is honored or making very explicit major version releases that might break things.

@michelp michelp merged commit 99d5f22 into michelp:main Jan 30, 2023
@ioguix
Copy link
Collaborator Author

ioguix commented Jan 30, 2023

Thank you!

@ioguix ioguix deleted the schema_tests branch June 9, 2023 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants