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

DAT-18667: Updated snapshot test suite test files. #185

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/lth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
max-parallel: 1
matrix:
liquibase-support-level: [Foundational, Contributed] # Define the different test levels to run
liquibase-support-level: [Foundational, Contributed, Advanced] # Define the different test levels to run
fail-fast: false # Set fail-fast to false to run all test levels even if some of them fail

steps:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package liquibase.ext.databricks;

import liquibase.harness.AdvancedHarnessSuite;
import liquibase.harness.snapshot.SnapshotObjectTests;
import org.junit.platform.suite.api.SelectClasses;

@SelectClasses({SnapshotObjectTests.class})
public class AdvancedExtensionHarnessTestSuite extends AdvancedHarnessSuite {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet id="1" author="as">
<createTable tableName="test_table">
<column name="test_column" type="INT"/>
</createTable>
<rollback/>
</changeSet>
<changeSet id="2" author="as">
<addColumn tableName="test_table">
<column name="stringColumn" type="STRING" value="INITIAL_VALUE"/>
<column name="varcharColumn" type="varchar(25)" value="INITIAL_VALUE"/>
<column name="intColumn" type="int" valueNumeric="5"/>
<column name="dateColumn" type="date" valueDate="2020-09-21"/>
</addColumn>
<rollback>
<dropTable tableName="test_table"/>
</rollback>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet id="1" author="as">
<createTable tableName="test_table">
<column name="id" type="INT">
<constraints nullable="false"/>
</column>
</createTable>
<rollback>
<dropTable tableName="test_table"/>
</rollback>
</changeSet>
<changeSet id="2" author="as">
<addPrimaryKey
columnNames="id"
constraintName="test_pk"
tableName="test_table"
validate="true"/>
<rollback>
<dropPrimaryKey tableName="test_table"
constraintName="test_pk"/>
</rollback>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<!-- Unique constraints are not supported for Databrick. Remove test data for this changetype after refactoring of snapshot test-->
<changeSet id="1" author="cody">
<createTable tableName="test_table">
<!--Changetype not supported. We need to override test-harness existing changelog in order to work for this suite-->
<changeSet id="1" author="as">
<createTable tableName="test_table_unique">
<column name="id" type="INT"/>
</createTable>
<rollback>
<dropTable tableName="test_table"/>
<dropTable tableName="test_table_unique"/>
</rollback>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<!--Changetype not supported. We need to override test-harness existing changelog in order to work for this suite-->
<changeSet id="1" author="codydavis">
<createTable tableName="test_table_index">
<column name="id" type="INT"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet id="1" author="as">
<createTable tableName="snapshot_test_table">
<column name="snapshot_test_column" type="INT"/>
</createTable>
<rollback>
<dropTable tableName="snapshot_test_table"/>
</rollback>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet id="1" author="mykhailo">
<createTable tableName="view_table">
<column name="test_column" type="INT"/>
</createTable>
<rollback>
<dropTable tableName="view_table"/>
</rollback>
</changeSet>
<changeSet id="2" author="mykhailo">
<createView viewName="test_view">
select test_column from main.liquibase_harness_test_ds.view_table
</createView>
<rollback>
<dropView viewName="test_view"/>
</rollback>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet id="1" author="mykhailo">
<createTable tableName="snapshot_test_table">
<column name="snapshot_test_column" type="INT"/>
</createTable>
<rollback>
<dropTable tableName="snapshot_test_table"/>
</rollback>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
}
}
},
{
"column": {
"name": "stringColumn",
"nullable": true,
"type": {
"typeName": "STRING"
}
}
},
{
"column": {
"name": "varcharColumn",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"liquibase.structure.core.Table": [
{
"table": {
"name": "test_table"
"name": "test_table_unique"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"snapshot": {
"objects": {
"liquibase.structure.core.Table": [
{
"table": {
"name": "snapshot_test_table"
}
}
],
"liquibase.structure.core.Column": [
{
"column": {
"name": "snapshot_test_column",
"type": {
"typeName": "INT"
}
}
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"snapshot": {
"objects": {
"liquibase.structure.core.Table": [
{
"table": {
"name": "view_table"
}
}
],
"liquibase.structure.core.View": [
{
"view": {
"definition": "select test_column from main.liquibase_harness_test_ds.view_table",
"name": "test_view"
}
}
]
}
}
}

This file was deleted.

This file was deleted.

Loading