-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add liquibase harness tests v.1.0.10 (#375)
* add liquibase harness tests v.1.0.10 * add test runner for Liquibase test harness * Ignore Data loadUpdate liquibase harness test * add new workflow * fixing dependency * resolve comments * Add tests and clarifications for ignored tests * chore: delete derby.log file --------- Co-authored-by: Knut Olav Løite <[email protected]>
- Loading branch information
1 parent
876d6ef
commit 21725a3
Showing
86 changed files
with
886 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
on: | ||
pull_request: | ||
name: gradle harness test | ||
jobs: | ||
ubuntu: | ||
services: | ||
emulator: | ||
image: gcr.io/cloud-spanner-emulator/emulator:latest | ||
ports: | ||
- 9010:9010 | ||
- 9020:9020 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
java: [11, 17] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: zulu | ||
java-version: ${{matrix.java}} | ||
- run: java -version | ||
- run: ./gradlew clean liquibaseHarnessTest | ||
- run: ./gradlew clean build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/test/groovy/liquibase/ext/spanner/CloudSpannerAdvancedHarnessSuiteTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package liquibase.ext.spanner | ||
|
||
import liquibase.harness.AdvancedHarnessSuite | ||
import liquibase.harness.snapshot.SnapshotObjectTests | ||
import org.junit.platform.suite.api.SelectClasses | ||
|
||
@SelectClasses(SnapshotObjectTests.class) | ||
class CloudSpannerAdvancedHarnessSuiteTest extends AdvancedHarnessSuite{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/test/resources/liquibase/harness/change/changelogs/cloudspanner/1initScript.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?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-3.8.xsd"> | ||
<changeSet id="1" author="spanner-liquibase-tests"> | ||
<sqlFile path="init.txt" | ||
relativeToChangelogFile="true" | ||
stripComments="true"/> | ||
<rollback/> | ||
</changeSet> | ||
</databaseChangeLog> |
15 changes: 15 additions & 0 deletions
15
src/test/resources/liquibase/harness/change/changelogs/cloudspanner/addLookupTable.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-3.8.xsd"> | ||
<changeSet author="spanner-liquibase-tests" id="1"> | ||
<addLookupTable | ||
existingColumnName="email" | ||
existingTableName="authors" | ||
newColumnDataType="STRING(100)" | ||
newColumnName="authors_email" | ||
newTableName="authors_data"/> | ||
</changeSet> | ||
</databaseChangeLog> |
15 changes: 15 additions & 0 deletions
15
src/test/resources/liquibase/harness/change/changelogs/cloudspanner/createTableTimestamp.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-3.8.xsd"> | ||
<changeSet id="1" author="spanner-liquibase-tests"> | ||
<createTable tableName="lms_create_table_test"> | ||
<column name="lms_test_id" type="INTEGER"> | ||
<constraints primaryKey="true" nullable="false"/> | ||
</column> | ||
<column name="lms_test_timestamp" type="TIMESTAMP"/> | ||
</createTable> | ||
</changeSet> | ||
</databaseChangeLog> |
15 changes: 15 additions & 0 deletions
15
src/test/resources/liquibase/harness/change/changelogs/cloudspanner/createView.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="2" author="oleh"> | ||
<createView viewName="test_view"> | ||
select authors.id, authors.first_name, authors.last_name, authors.email from authors | ||
</createView> | ||
<rollback> | ||
<dropView viewName="test_view"/> | ||
</rollback> | ||
</changeSet> | ||
</databaseChangeLog> |
15 changes: 15 additions & 0 deletions
15
src/test/resources/liquibase/harness/change/changelogs/cloudspanner/dropView.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="2" author="oleh"> | ||
<createView viewName="test_view"> | ||
select authors.id, authors.first_name, authors.last_name, authors.email from authors | ||
</createView> | ||
<dropView viewName="test_view"/> | ||
<rollback/> | ||
</changeSet> | ||
</databaseChangeLog> |
37 changes: 37 additions & 0 deletions
37
src/test/resources/liquibase/harness/change/changelogs/cloudspanner/init.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
DROP TABLE IF EXISTS authors; | ||
|
||
CREATE TABLE authors ( | ||
id INT64 NOT NULL, | ||
first_name STRING(1024), | ||
last_name STRING(1024), | ||
email STRING(1024), | ||
birthdate DATE, | ||
added TIMESTAMP | ||
) PRIMARY KEY (id); | ||
|
||
|
||
INSERT INTO authors (id, first_name, last_name, email, birthdate, added) | ||
VALUES (1, 'Alice', 'Doe', '[email protected]', '1990-07-15', '2012-12-25T10:45:00Z'); | ||
|
||
INSERT INTO authors (id, first_name, last_name, email, birthdate, added) | ||
VALUES (2, 'John', 'Smith', '[email protected]', '1985-11-22', '2015-08-10T14:30:00Z'); | ||
|
||
DROP TABLE IF EXISTS posts; | ||
|
||
CREATE TABLE posts ( | ||
id INT64 NOT NULL, | ||
author_id INT64 NOT NULL, | ||
title STRING(1024), | ||
description STRING(1024), | ||
content STRING(1024), | ||
inserted_date DATE, | ||
) | ||
PRIMARY KEY (id); | ||
|
||
|
||
INSERT INTO posts (id, author_id, title, description, content, inserted_date) | ||
VALUES (1, 1, 'libero', 'perspiciatis', 'Saepe laboriosam cupiditate consequatur distinctio.', '2020-07-14'); | ||
|
||
INSERT INTO posts (id, author_id, title, description, content, inserted_date) | ||
VALUES (2, 2, 'rerum', 'voluptates', 'Consequuntur assumenda adipisci vel repellendus.', '1982-02-25'); | ||
|
55 changes: 55 additions & 0 deletions
55
src/test/resources/liquibase/harness/change/changelogs/cloudspanner/mergeColumns.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?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-3.8.xsd"> | ||
<changeSet id="1" author="spanner-liquibase-tests"> | ||
<createTable tableName="full_name_table"> | ||
<column name="id" type="int"> | ||
<constraints primaryKey="true" nullable="false"/> | ||
</column> | ||
<column name="first_name" | ||
type="string(50)"/> | ||
<column name="last_name" | ||
type="string(50)"/> | ||
</createTable> | ||
<rollback/> | ||
</changeSet> | ||
<changeSet id="2" author="spanner-liquibase-tests"> | ||
<insert tableName="full_name_table"> | ||
<column name="id" | ||
valueNumeric="1"/> | ||
<column name="first_name" | ||
value="John"/> | ||
</insert> | ||
<update tableName="full_name_table"> | ||
<column name="last_name" | ||
value="Doe"/> | ||
<where>first_name='John'</where> | ||
</update> | ||
<insert tableName="full_name_table"> | ||
<column name="id" | ||
valueNumeric="2"/> | ||
<column name="first_name" | ||
value="Jane"/> | ||
</insert> | ||
<update tableName="full_name_table"> | ||
<column name="last_name" | ||
value="Doe"/> | ||
<where>first_name='Jane'</where> | ||
</update> | ||
<rollback/> | ||
</changeSet> | ||
<changeSet id="3" author="spanner-liquibase-tests"> | ||
<mergeColumns column1Name="first_name" | ||
column2Name="last_name" | ||
finalColumnName="full_name" | ||
finalColumnType="string(255)" | ||
joinString=" " | ||
tableName="full_name_table"/> | ||
<rollback> | ||
<dropTable tableName="full_name_table"/> | ||
</rollback> | ||
</changeSet> | ||
</databaseChangeLog> |
28 changes: 28 additions & 0 deletions
28
src/test/resources/liquibase/harness/change/changelogs/cloudspanner/modifyDataType.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="spanner-liquibase-tests"> | ||
<createTable tableName="modify_data_type_test"> | ||
<column name="id" type="int"> | ||
<constraints primaryKey="true" nullable="false"/> | ||
</column> | ||
<column name="stringColumn" type="string(50)"/> | ||
<column name="dateColumn" type="date"/> | ||
</createTable> | ||
<rollback> | ||
<dropTable tableName="modify_data_type_test"/> | ||
</rollback> | ||
</changeSet> | ||
<changeSet id="2" author="as"> | ||
<sql> | ||
ALTER TABLE modify_data_type_test ALTER COLUMN stringColumn BYTES(50) | ||
</sql> | ||
<!-- <modifyDataType columnName="stringColumn"--> | ||
<!-- newDataType="binary"--> | ||
<!-- tableName="modify_data_type_test"/>--> | ||
<rollback/> | ||
</changeSet> | ||
</databaseChangeLog> |
Oops, something went wrong.