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

Support "Advanced" level validation #28

Merged
merged 23 commits into from
Sep 28, 2023
Merged

Support "Advanced" level validation #28

merged 23 commits into from
Sep 28, 2023

Conversation

nvoxland
Copy link
Contributor

@nvoxland nvoxland commented May 31, 2023

Description

Ensures the extension meets the "advanced" support level requirements https://www.liquibase.com/supported-databases/verification-levels

Notes

Adds additional test-harness suites:

  • ContributedExtensionHarnessTestSuite which mostly tests that the standard change tests either work correctly or are known to be supported.
  • AdvacedExtensionHarnessSuite which checks the generate-changelog logic and the snapshot logic more directly

You can run them locally, and they are set up to run on the the build system. The ContributedExtensionSupport is probably the best one to start with

The build system side will need some updates to the terraform and/or execution setup. They run concurrently, so we'll need separate schemas or something so they don't get in the way of each other. I'm not sure the best way to configure that yet, so I just left it as failing and we'll work on it later.

For getting the advanced/contributed tests to pass, some good starting spots for the test-harness:

The high-level version of those links, is that the test-harness library ships with a bunch of tests within it, with those tests example changelog files and then standard "expectation" files.

Example:

  • In the Contributed suite, there is a liquibase/harness/change/changelogs/createTable.xml file which creates a table. The existence of this changelog file defines that there is a "createTable" test
  • The first time you run the tests, it will create a databricks-specific liquibase/harness/change/expectedSql/databricks/createTable.sql file that has the SQL ran for to you to ensure looks correct and will be used going forward to ensure there are no unexpected changes to that SQL. If the bundled test is not valid for your database, you can put "INVALID TEST" and a reason in this file and it will know to skip the test
  • It will also use the shipped liquibase/harness/change/expectedSnapshot/createTable.json file to check that the table was created correctly, but if that doesn't match what correctly comes back from databricks for some reason, you can create a liquibase/harness/change/expectedSnapshot/databricks/createTable.json with whatever is correct for you.

nvoxland and others added 23 commits May 31, 2023 15:29
Set up support to begin running contributed tests with init script, and addColumn change type tests passing
1. Finished Contributed Tests (loadUpdateData, etc.)
2. Make GitActions do each testing level in series to not disturb the others
1. Fix Foreign Key Snapshotting
2. Start createIndex change type mapping to CLUSTER BY
Add support and tests for creating partitioned tables
Finish Advanced Test Harness
Updating to the most recent version of the build logic to see if the Sonar scan issue is fixed.
@CodyAustinDavis CodyAustinDavis marked this pull request as ready for review September 28, 2023 16:03
@filipelautert filipelautert merged commit d063292 into main Sep 28, 2023
15 of 16 checks passed
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.

4 participants