Skip to content

Commit b4b8561

Browse files
committed
CDM-28 adding Counter tests
1 parent 9fc5caa commit b4b8561

File tree

13 files changed

+202
-1
lines changed

13 files changed

+202
-1
lines changed

SIT/smoke/04_counters/breakData.cql

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
UPDATE source.smoke_counters SET col1=col1+1 WHERE key='record2';
3+
4+
-- CDM-29 discovered that this record will "zombie"...
5+
DELETE FROM target.smoke_counters where key='record3';
6+
7+
-- change by same amount on both sides, records should match
8+
UPDATE source.smoke_counters SET col2=col2+1 WHERE key='record4';
9+
UPDATE target.smoke_counters SET col2=col2+1 WHERE key='record4';
10+
11+
-- change by different amounts, they shouuld be brought into alignment with
12+
-- source, even if that means going down
13+
UPDATE source.smoke_counters SET col2=col2+1 WHERE key='record5';
14+
UPDATE target.smoke_counters SET col2=col2+2 WHERE key='record5';
15+
16+
SELECT * FROM source.smoke_counters;
17+
SELECT * FROM target.smoke_counters;
18+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Read Record Count: 5
2+
Mismatch Record Count: 2
3+
Corrected Mismatch Record Count: 2
4+
Missing Record Count: 1
5+
Corrected Missing Record Count: 1
6+
Valid Record Count: 2
7+
Skipped Record Count: 0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Read Record Count: 5
2+
Skipped Record Count: 0
3+
Write Record Count: 5
4+
Error Record Count: 0

SIT/smoke/04_counters/cdm.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
migrateData datastax.astra.migrate.Migrate migrate.properties
2+
validateData datastax.astra.migrate.DiffData migrate.properties
3+
fixData datastax.astra.migrate.DiffData fix.properties
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Read Record Count: 5
2+
Mismatch Record Count: 0
3+
Corrected Mismatch Record Count: 0
4+
Missing Record Count: 0
5+
Corrected Missing Record Count: 0
6+
Valid Record Count: 5
7+
Skipped Record Count: 0

SIT/smoke/04_counters/execute.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -e
2+
3+
workingDir="$1"
4+
cd "$workingDir"
5+
6+
/local/cdm.sh -f cdm.txt -s migrateData -d "$workingDir" > cdm.migrateData.out 2>cdm.migrateData.err
7+
/local/cdm-assert.sh -f cdm.migrateData.out -a cdm.migrateData.assert -d "$workingDir"
8+
9+
/local/cdm.sh -f cdm.txt -s validateData -d "$workingDir" > cdm.validateData.out 2>cdm.validateData.err
10+
/local/cdm-assert.sh -f cdm.validateData.out -a cdm.validateData.assert -d "$workingDir"
11+
12+
cqlsh -u $CASS_USERNAME -p $CASS_PASSWORD $CASS_CLUSTER -f $workingDir/breakData.cql > $workingDir/breakData.out 2> $workingDir/breakData.err
13+
14+
/local/cdm.sh -f cdm.txt -s fixData -d "$workingDir" > cdm.fixData.out 2>cdm.fixData.err
15+
/local/cdm-assert.sh -f cdm.fixData.out -a cdm.fixData.assert -d "$workingDir"

SIT/smoke/04_counters/expected.cql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT key,col1,col2 FROM target.smoke_counters;

SIT/smoke/04_counters/expected.out

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
key | col1 | col2
3+
---------+-------+-------
4+
record3 | 2000 | 4000
5+
record5 | 500 | 501
6+
record2 | 11 | 20
7+
record1 | 1 | 2
8+
record4 | 10000 | 20001
9+
10+
(5 rows)

SIT/smoke/04_counters/fix.properties

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
spark.origin.host cdm-sit-cass
2+
spark.origin.port 9042
3+
spark.origin.username cassandra
4+
spark.origin.password cassandra
5+
spark.origin.keyspaceTable source.smoke_counters
6+
7+
spark.target.host cdm-sit-cass
8+
spark.target.port 9042
9+
spark.target.username cassandra
10+
spark.target.password cassandra
11+
spark.target.keyspaceTable target.smoke_counters
12+
13+
spark.numSplits 1
14+
15+
spark.query.origin key,col1,col2
16+
spark.query.types 0,2,2
17+
spark.query.origin.partitionKey key
18+
spark.query.target.id key
19+
20+
spark.counterTable.cql.index 1,2
21+
22+
spark.target.autocorrect.missing true
23+
spark.target.autocorrect.mismatch true
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
spark.origin.host cdm-sit-cass
2+
spark.origin.port 9042
3+
spark.origin.username cassandra
4+
spark.origin.password cassandra
5+
spark.origin.keyspaceTable source.smoke_counters
6+
7+
spark.target.host cdm-sit-cass
8+
spark.target.port 9042
9+
spark.target.username cassandra
10+
spark.target.password cassandra
11+
spark.target.keyspaceTable target.smoke_counters
12+
13+
spark.numSplits 1
14+
15+
spark.query.origin key,col1,col2
16+
spark.query.types 0,2,2
17+
spark.query.origin.partitionKey key
18+
spark.query.target.id key
19+
20+
spark.counterTable.cql.index 1,2

0 commit comments

Comments
 (0)