Skip to content

Commit

Permalink
Merge branch 'main' into priyanshi/invalid-cnt-rename-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshi-yb committed Dec 13, 2024
2 parents 40d335c + 75ab89e commit 333a7e1
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/misc-migtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

services:
postgres:
image: postgres:13
image: postgres:14
env:
POSTGRES_PASSWORD: secret
# Set health checks to wait until postgres has started
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.RAHULB_S3_SECRET_ACCESS_KEY }}
if: ${{ !cancelled() }}
run: |
versions=("2.20.5.0-b72" "2.21.1.0-b271" "2024.1.1.0-b137")
versions=("2024.2.0.0-b145" "2.20.8.0-b53" "2024.1.3.1-b8" "2.23.1.0-b220")
for version in "${versions[@]}"; do
echo "Running tests on version $version"
Expand All @@ -108,6 +108,9 @@ jobs:
echo "127.0.0.1 yb-master-n1" | sudo tee -a /etc/hosts
psql "postgresql://yugabyte@yb-tserver-n1:5433/yugabyte" -c "SELECT version();"
echo "TEST: PG sample schemas (omnibus)"
migtests/scripts/run-schema-migration.sh pg/omnibus
echo "Setup the gcp credentials"
migtests/scripts/gcs/create_gcs_credentials_file
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mysql-migtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
run-mysql-migration-tests:
strategy:
matrix:
version: [2.21.1.0-b271, 2024.1.1.0-b137, 2.20.5.0-b72]
version: [2024.2.0.0-b145, 2.20.8.0-b53, 2024.1.3.1-b8, 2.23.1.0-b220]
BETA_FAST_DATA_EXPORT: [0, 1]
env:
BETA_FAST_DATA_EXPORT: ${{ matrix.BETA_FAST_DATA_EXPORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pg-9-migtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
run-pg-migration-tests:
strategy:
matrix:
version: [2.21.1.0-b271]
version: [2024.2.0.0-b145]
BETA_FAST_DATA_EXPORT: [0, 1]
env:
BETA_FAST_DATA_EXPORT: ${{ matrix.BETA_FAST_DATA_EXPORT }}
Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/pg-migtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
run-pg-migration-tests:
strategy:
matrix:
version: [2.21.1.0-b271, 2024.1.1.0-b137, 2.20.5.0-b72]
version: [2024.2.0.0-b145, 2.20.8.0-b53, 2024.1.3.1-b8, 2.23.1.0-b220]
BETA_FAST_DATA_EXPORT: [0, 1]
test_group:
- offline
Expand Down Expand Up @@ -52,9 +52,10 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: "Enable postgres with wal_level as logical"
- name: "Enable postgres with wal_level as logical and install postgis"
run: |
docker exec ${{ job.services.postgres.id }} sh -c "echo 'wal_level=logical' >> /var/lib/postgresql/data/postgresql.conf"
docker exec ${{ job.services.postgres.id }} sh -c "apt-get update && apt-get install -y postgresql-13-postgis postgresql-13-postgis-3"
docker restart ${{ job.services.postgres.id }}
sleep 10
Expand Down Expand Up @@ -106,6 +107,30 @@ jobs:
echo "127.0.0.1 yb-master-n1" | sudo tee -a /etc/hosts
psql "postgresql://yugabyte@yb-tserver-n1:5433/yugabyte" -c "SELECT version();"
- name: "TEST: PG sample schemas (sakila)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-schema-migration.sh pg/sakila

- name: "TEST: PG sample schemas (osm)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-schema-migration.sh pg/osm

- name: "TEST: PG sample schemas (adventureworks)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-schema-migration.sh pg/adventureworks

- name: "TEST: PG sample schemas (sample-is)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-schema-migration.sh pg/sample-is

- name: "TEST: PG sample schemas (pgtbrus)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-schema-migration.sh pg/pgtbrus\

- name: "TEST: PG sample schemas (stackexchange)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-schema-migration.sh pg/stackexchange

- name: "TEST: pg-table-list-flags-test (table-list and exclude-table-list)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/table-list-flags-tests
Expand Down
90 changes: 90 additions & 0 deletions yb-voyager/src/query/queryissue/issues_ddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,84 @@ func testAlterTableAddPKOnPartitionIssue(t *testing.T) {
assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "changing primary key of a partitioned table is not yet implemented", alterTableAddPKOnPartitionIssue)
}

func testSetAttributeIssue(t *testing.T) {
ctx := context.Background()
conn, err := getConn()
assert.NoError(t, err)

defer conn.Close(context.Background())
_, err = conn.Exec(ctx, `
CREATE TABLE public.event_search (
event_id text,
room_id text,
sender text,
key text,
vector tsvector,
origin_server_ts bigint,
stream_ordering bigint
);
ALTER TABLE ONLY public.event_search ALTER COLUMN room_id SET (n_distinct=-0.01)`)

assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ALTER TABLE ALTER column not supported yet", setAttributeIssue)
}

func testClusterOnIssue(t *testing.T) {
ctx := context.Background()
conn, err := getConn()
assert.NoError(t, err)

defer conn.Close(context.Background())
_, err = conn.Exec(ctx, `
CREATE TABLE test(ID INT PRIMARY KEY NOT NULL,
Name TEXT NOT NULL,
Age INT NOT NULL,
Address CHAR(50),
Salary REAL);
CREATE UNIQUE INDEX test_age_salary ON public.test USING btree (age ASC NULLS LAST, salary ASC NULLS LAST);
ALTER TABLE public.test CLUSTER ON test_age_salary`)

assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ALTER TABLE CLUSTER not supported yet", clusterOnIssue)
}

func testDisableRuleIssue(t *testing.T) {
ctx := context.Background()
conn, err := getConn()
assert.NoError(t, err)

defer conn.Close(context.Background())
_, err = conn.Exec(ctx, `
create table trule (a int);
create rule trule_rule as on update to trule do instead nothing;
ALTER TABLE trule DISABLE RULE trule_rule`)

assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ALTER TABLE DISABLE RULE not supported yet", disableRuleIssue)
}

func testStorageParameterIssue(t *testing.T) {
ctx := context.Background()
conn, err := getConn()
assert.NoError(t, err)

defer conn.Close(context.Background())
_, err = conn.Exec(ctx, `
CREATE TABLE public.example (
name text,
email text,
new_id integer NOT NULL,
id2 integer NOT NULL,
CONSTRAINT example_name_check CHECK ((char_length(name) > 3))
);
ALTER TABLE ONLY public.example
ADD CONSTRAINT example_email_key UNIQUE (email) WITH (fillfactor = 70);`)

assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "unrecognized parameter", storageParameterIssue)
}

func TestDDLIssuesInYBVersion(t *testing.T) {
var err error
ybVersion := os.Getenv("YB_VERSION")
Expand Down Expand Up @@ -202,4 +280,16 @@ func TestDDLIssuesInYBVersion(t *testing.T) {
success = t.Run(fmt.Sprintf("%s-%s", "alter table add PK on partition", ybVersion), testAlterTableAddPKOnPartitionIssue)
assert.True(t, success)

success = t.Run(fmt.Sprintf("%s-%s", "set attribute", ybVersion), testSetAttributeIssue)
assert.True(t, success)

success = t.Run(fmt.Sprintf("%s-%s", "cluster on", ybVersion), testClusterOnIssue)
assert.True(t, success)

success = t.Run(fmt.Sprintf("%s-%s", "disable rule", ybVersion), testDisableRuleIssue)
assert.True(t, success)

success = t.Run(fmt.Sprintf("%s-%s", "storage parameter", ybVersion), testStorageParameterIssue)
assert.True(t, success)

}

0 comments on commit 333a7e1

Please sign in to comment.