Skip to content

Commit

Permalink
Merge pull request #194 from datastax/issue/CDM-93
Browse files Browse the repository at this point in the history
CDM-93: Added SIT tests
  • Loading branch information
Ankitp1342 authored Aug 30, 2023
2 parents b98aa26 + 7e933f2 commit 696ea87
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 0 deletions.
24 changes: 24 additions & 0 deletions SIT/smoke/05_reserved_keyword/cdm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -e

cat <<EOF
!!!!!!!!
!!!!!!!! Testing Migrate
!!!!!!!!
EOF

/local/cdm.sh -c
spark-submit \
--properties-file /smoke/05_reserved_keyword/migrate.properties \
--master "local[*]" \
--class datastax.cdm.job.Migrate /local/cassandra-data-migrator.jar

cat <<EOF
!!!!!!!!
!!!!!!!! Testing DiffData
!!!!!!!!
EOF

spark-submit \
--properties-file /smoke/05_reserved_keyword/migrate.properties \
--master "local[*]" \
--class datastax.cdm.job.DiffData /local/cassandra-data-migrator.jar
2 changes: 2 additions & 0 deletions SIT/smoke/05_reserved_keyword/cdm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
migrateData com.datastax.cdm.job.Migrate migrate.properties
validateData com.datastax.cdm.job.DiffData migrate.properties
9 changes: 9 additions & 0 deletions SIT/smoke/05_reserved_keyword/execute.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e

workingDir="$1"
cd "$workingDir"

for scenario in $(cat cdm.txt | awk '{print $1}'); do
/local/cdm.sh -f cdm.txt -s $scenario -d "$workingDir"
done

1 change: 1 addition & 0 deletions SIT/smoke/05_reserved_keyword/expected.cql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT * FROM target.smoke_order;
7 changes: 7 additions & 0 deletions SIT/smoke/05_reserved_keyword/expected.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

col1 | order
------+-------
c1 | o1
c2 | o2

(2 rows)
10 changes: 10 additions & 0 deletions SIT/smoke/05_reserved_keyword/migrate.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
spark.cdm.connect.origin.host cdm-sit-cass
spark.cdm.connect.target.host cdm-sit-cass

spark.cdm.schema.origin.keyspaceTable origin.smoke_order
spark.cdm.schema.target.keyspaceTable target.smoke_order
spark.cdm.perfops.numParts 1

spark.cdm.autocorrect.missing true
spark.cdm.autocorrect.mismatch true

9 changes: 9 additions & 0 deletions SIT/smoke/05_reserved_keyword/setup.cql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DROP TABLE IF EXISTS origin.smoke_order;
CREATE TABLE origin.smoke_order (col1 text primary key, "order" text);
INSERT INTO origin.smoke_order(col1, "order") VALUES ('c1','o1');
INSERT INTO origin.smoke_order(col1, "order") VALUES ('c2','o2');

DROP TABLE IF EXISTS target.smoke_order;
CREATE TABLE target.smoke_order (col1 text primary key, "order" text);


0 comments on commit 696ea87

Please sign in to comment.