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

Advanced Test completion #435

Merged
merged 50 commits into from
Dec 22, 2022
Merged

Advanced Test completion #435

merged 50 commits into from
Dec 22, 2022

Conversation

AlexanderSashchenko
Copy link
Contributor

@AlexanderSashchenko AlexanderSashchenko commented Nov 23, 2022

Here are described workflows implemented to fit all technical rquirements for Advanced test accordingly:
I) Implemented generateChangelog test in AdvancedTest.groovy. Workflow::
1) Execute Liquibase update command;
2) Execute Liquibase generateChangelog command
3) Validate generated changelog by checking for presence of change type name in initial changelog and generated changelog for .xml, .yml, .json.. For .sql changelog we check for full equality of sql statements in generated changelog and initial changelog.
4) Rollback changes
5) Repeat consiquently for all four fie formats.

II) Implemented diffChangelog test DiffCommandTest.groovy. Workflow for diffChangelog test:
1) Execute Liquibase update command against target database
2) Execute Liquibase diffChangelog command for all four file formats
3) Validate generated diffChangelog (expected to find opposite change type to one in original changelog: e.g. createTable -> dropTable (drop table for .sql), createView -> dropView (drop view for .sql), addForeignKey -> dropForeignKey etc. (drop constraint for .sql))
4) Rollback changes

III) Modified diff test in DiffCommandTest.groovy. Current workflow:
1) Execute Liquibase update command against target database (target and reference databases are of the same type)
2) Execute Liquibase diff command and obtain diff content in .txt
3) Compare generated diff content to expected diff content (full equality comparison)
4) Rollback changes

IV) Modified Snapshot test in SnapshotObjectTest.groovy. Current workflow:
1) Execute Liquibase snapshot command
2) Execute Liquibase snapshot command (.json format)
3) Compare generated snapshot to expected snapshot snippet (Comparison checks for presence of objects from expected snapshot snippet in generated snapshot)
4) Rollback changes

V) Stress test (was implemented in previous version in AdvancedTest.groovy):
1) Run consiquently Liquibase update command that creates a table with 50 columns, inserts 10k rows into it, updates data in all rows, selects all data
2) Track execution time of all operations
2) Rollback changes

As a result current version of Advanced test consists of 3 parts:
AdvancedTest.grovvy (Stress test and generateChangelog command test) <-
DiffCommandTest (diffChangelog command test and diff command test)
SnapshotObjectTest.groovy (Snapshot command test)

All these parts will be united and run in a singe test suite.

@AlexanderSashchenko AlexanderSashchenko marked this pull request as draft November 23, 2022 13:00
@kristyldatical kristyldatical self-requested a review November 23, 2022 18:26
@AlexanderSashchenko AlexanderSashchenko changed the title Foundational Test completion Advanced Test completion Dec 6, 2022
@yodzhubeiskyi yodzhubeiskyi marked this pull request as ready for review December 20, 2022 14:29
@PavloTytarchuk
Copy link
Contributor

PavloTytarchuk commented Dec 22, 2022

@PavloTytarchuk PavloTytarchuk merged commit 8329566 into main Dec 22, 2022
@yodzhubeiskyi yodzhubeiskyi deleted the DAT-12226 branch December 22, 2022 14:13
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.

5 participants