Skip to content

Commit

Permalink
[DAT-17410] enable test-harness (#279)
Browse files Browse the repository at this point in the history
* downgraded parent pom, added groovy and spock explicitly

* wip

* enabled tests, need more work

* reverted unneeded changes

* removed documentation workflow

* replaces level to Contributed

* removed expectedSQL for initScript
  • Loading branch information
KushnirykOleh authored Apr 10, 2024
1 parent dcc3eb9 commit 6ac90d9
Show file tree
Hide file tree
Showing 53 changed files with 64 additions and 156 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/documentation.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test-harness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
needs: [setup]
strategy:
matrix:
liquibase-support-level: [Foundational ] # Define the different test levels to run
liquibase-support-level: [Contributed ] # 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
env:
github-token: ${{ secrets.LIQUIBOT_PAT_GPM_ACCESS }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/liquibase-biqquery.iml
/.idea/
/target/
/build
derby.log
liquibase-bigquery.iml
src/test/java/BigqueryIT.java
Expand Down
5 changes: 4 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-parent-pom</artifactId>
<version>0.3.7</version>
<version>0.3.6</version>
</parent>

<groupId>org.liquibase.ext</groupId>
Expand All @@ -18,6 +18,9 @@

<properties>
<liquibase.version>4.27.0</liquibase.version>
<spock-core.version>1.3-groovy-2.4</spock-core.version>
<spock-reports.version>1.8.0</spock-reports.version>
<groovy-all.version>2.4.21</groovy-all.version>
<sonar.tests>src/test/groovy</sonar.tests>
</properties>

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support auto increment
INVALID TEST -- BigQuery doesn't support auto increment
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support check constraints
INVALID TEST -- BigQuery doesn't support check constraints
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
INVALID TEST
---
'BigQuery does not handle properly column drops which is tested as last step in this test
ALTER TABLE lharness.authors ADD COLUMN varcharColumn STRING
ALTER TABLE lharness.authors ADD COLUMN intColumn INT64
ALTER TABLE lharness.authors ADD COLUMN dateColumn date
UPDATE lharness.authors SET varcharColumn = "INITIAL_VALUE" WHERE 1 = 1
UPDATE lharness.authors SET intColumn = 5 WHERE 1 = 1
UPDATE lharness.authors SET dateColumn = "2020-09-21" WHERE 1 = 1
'
ALTER TABLE harness_test_ds.authors ADD COLUMN varcharColumn STRING
ALTER TABLE harness_test_ds.authors ADD COLUMN intColumn INT64
ALTER TABLE harness_test_ds.authors ADD COLUMN dateColumn date
UPDATE harness_test_ds.authors SET varcharColumn = 'INITIAL_VALUE' WHERE 1 = 1
UPDATE harness_test_ds.authors SET intColumn = 5 WHERE 1 = 1
UPDATE harness_test_ds.authors SET dateColumn = '2020-09-21' WHERE 1 = 1
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
'BigQuery does not support default values for columns'
INVALID TEST -- BigQuery does not support default values for columns
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support default values for columns
INVALID TEST -- BigQuery does not support default values for columns
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support default values for columns
INVALID TEST -- BigQuery does not support default values for columns
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support default values for columns
INVALID TEST -- BigQuery does not support default values for columns
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support default values for columns
INVALID TEST -- BigQuery does not support default values for columns
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support default values for columns
INVALID TEST -- BigQuery does not support default values for columns
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support FK
INVALID TEST -- BigQuery does not support FK
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support constraints
INVALID TEST -- BigQuery does not support constraints
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support PK
INVALID TEST -- BigQuery does not support PK
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support constraints
INVALID TEST -- BigQuery does not support constraints
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support sequences
INVALID TEST -- BigQuery doesn't support sequences
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support indexes
INVALID TEST -- BigQuery doesn't support indexes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support packages
INVALID TEST -- BigQuery doesn't support packages
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support package bodies
INVALID TEST -- BigQuery doesn't support package bodies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST
INVALID TEST -- procedure snapshot is a pro feature, we can't verify procedure was created without snapshotting
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST
INVALID TEST -- procedure snapshot is a pro feature, we can't verify procedure was created without snapshotting
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support sequences
INVALID TEST -- BigQuery doesn't support sequences
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support triggers
INVALID TEST -- BigQuery doesn't support triggers
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE VIEW harness_test_ds.test_view AS select id, first_name, last_name, email from authors
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support check constraints
INVALID TEST -- BigQuery doesn't support check constraints
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support triggers
INVALID TEST -- BigQuery doesn't support triggers
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support FK
INVALID TEST -- BigQuery does not support FK
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support check constraints
INVALID TEST -- BigQuery doesn't support check constraints
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support default values
INVALID TEST -- BigQuery doesn't support default values
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support FK
INVALID TEST -- BigQuery does not support FK
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support functions
INVALID TEST -- BigQuery doesn't support functions
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support indexes
INVALID TEST -- BigQuery doesn't support indexes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support constraints
INVALID TEST -- BigQuery does not support constraints
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support PK
INVALID TEST -- BigQuery does not support PK
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support sequences
INVALID TEST -- BigQuery doesn't support sequences
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support triggers
INVALID TEST -- BigQuery doesn't support triggers
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INVALID TEST BigQuery does not support constraints
INVALID TEST -- BigQuery does not support constraints
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support check constraints
INVALID TEST -- BigQuery doesn't support check constraints
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support triggers
INVALID TEST -- BigQuery doesn't support triggers
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support commands
INVALID TEST -- BigQuery doesn't support commands
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
INVALID TEST
---
'BigQuery does not handle properly column drops which is tested in this test'
CREATE TABLE harness_test_ds.full_name_table (first_name STRING(50), last_name STRING(50))
INSERT INTO harness_test_ds.full_name_table (first_name) VALUES ('John')
UPDATE harness_test_ds.full_name_table SET last_name = 'Doe' WHERE first_name='John'
INSERT INTO harness_test_ds.full_name_table (first_name) VALUES ('Jane')
UPDATE harness_test_ds.full_name_table SET last_name = 'Doe' WHERE first_name='Jane'
ALTER TABLE harness_test_ds.full_name_table ADD COLUMN full_name STRING(255)
UPDATE harness_test_ds.full_name_table SET full_name = first_name || ' ' || last_name WHERE 1 = 1
ALTER TABLE harness_test_ds.full_name_table DROP COLUMN first_name
ALTER TABLE harness_test_ds.full_name_table DROP COLUMN last_name

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE harness_test_ds.authors RENAME COLUMN first_name TO first_name_renameColumn_test
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support sequences
INVALID TEST -- BigQuery doesn't support sequences
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support rename
INVALID TEST -- BigQuery doesn't support rename
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
INVALID TEST
'CREATE VIEW test_view AS select dim_channel_key, channel_name, channel_type, publisher from authors
ALTER VIEW RENAME test_view TO test_view_new'
INVALID TEST -- BigQuery doesn't support view rename https://cloud.google.com/bigquery/docs/managing-views#rename_a_view
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support remarks
INVALID TEST -- BigQuery doesn't support remarks
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
INVALID TEST
-- BigQuery doesn't support remarks
INVALID TEST -- BigQuery doesn't support remarks

0 comments on commit 6ac90d9

Please sign in to comment.