Skip to content

Commit 15878dd

Browse files
committed
Update test script to extract run outputs
1 parent 244448a commit 15878dd

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

SIT/test.sh

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,18 @@ fi
3535
. common.sh
3636

3737
_captureOutput() {
38-
_info "Copying ${DOCKER_CDM}:/${testDir} into ${testDir}/output"
39-
docker cp ${DOCKER_CDM}:/${testDir} ${testDir}/output
40-
_info "Moving ${testDir}/output/*.out TO ${testDir}/output"
41-
mv ${testDir}/output/*.out ${testDir}/output
42-
_info "Moving ${testDir}/output/*.err TO ${testDir}/output"
43-
mv ${testDir}/output/*.err ${testDir}/output
38+
_info "Copying ${DOCKER_CDM}:/${testDir} into ${testDir}/output/"
39+
docker cp ${DOCKER_CDM}:/${testDir} ${testDir}/output/
40+
_info "Moving ${testDir}/output/$(basename ${testDir})/*.out TO ${testDir}/output/"
41+
mv -v ${testDir}/output/$(basename ${testDir})/*.out ${testDir}/output/
42+
_info "Moving ${testDir}/output/$(basename ${testDir})/*.err TO ${testDir}/output/"
43+
mv -v ${testDir}/output/$(basename ${testDir})/*.err ${testDir}/output/
44+
_info "Moving ${testDir}/output/$(basename ${testDir})/output/*.out TO ${testDir}/output/"
45+
mv -v ${testDir}/output/$(basename ${testDir})/output/*.out ${testDir}/output/
46+
_info "Moving ${testDir}/output/$(basename ${testDir})/output/*.err TO ${testDir}/output/"
47+
mv -v ${testDir}/output/$(basename ${testDir})/output/*.err ${testDir}/output/
48+
_info "Removing ${testDir}/output/$(basename ${testDir})"
49+
rm -rf ${testDir}/output/$(basename ${testDir})
4450
}
4551

4652
EXPECTED_FILES="setup.cql expected.cql expected.out execute.sh"
@@ -122,17 +128,17 @@ errors=0
122128
for testDir in $(ls -d ${PHASE}/*); do
123129
export testDir
124130
_info ${testDir} Executing test
125-
docker exec ${DOCKER_CDM} bash -e $testDir/execute.sh /$testDir > $testDir/output/execute.out 2>$testDir/output/execute.err
131+
docker exec ${DOCKER_CDM} bash -e -c "$testDir/execute.sh /$testDir > $testDir/output/execute.out 2>$testDir/output/execute.err"
126132
if [ $? -ne 0 ]; then
127133
_error "${testDir}/execute.sh failed, see $testDir/output/execute.out and $testDir/output/execute.err"
128-
echo "=-=-=-=-=-=-=-=-=-= Directory Listing =-=-=-=-=-=-=-=-=-=-"
129-
echo "$(ls -laR ${testDir})"
134+
echo "=-=-=-=-=-=-=- Container Directory Listing -=-=-=-=-=-=-=-"
135+
echo "$(docker exec ${DOCKER_CDM} ls -laR ${testDir})"
130136
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-==-=-=-=-=-=-=-=-=-=-=-=-"
137+
_captureOutput
131138
errors=1
132139
fi
133140
done
134141
if [ $errors -ne 0 ]; then
135-
_captureOutput
136142
_fatal "One or more execute.sh failed. See above ERROR(s) for details."
137143
fi
138144

@@ -154,6 +160,7 @@ for testDir in $(ls -d ${PHASE}/*); do
154160
fi
155161
if [ $? -ne 0 ]; then
156162
_error "${testDir}/expected.cql failed, see $testDir/output/actual.out $testDir/output/and actual.err"
163+
_captureOutput
157164
errors=1
158165
continue
159166
fi
@@ -162,18 +169,19 @@ for testDir in $(ls -d ${PHASE}/*); do
162169
if [ $rtn -eq 1 ]; then
163170
_error "${testDir} files differ (expected vs actual):"
164171
sdiff -w 200 ${testDir}/expected.out ${testDir}/output/actual.out
172+
_captureOutput
165173
errors=1
166174
continue
167175
elif [ $rtn -ne 0 ]; then
168176
_error "${testDir} had some other problem running diff"
177+
_captureOutput
169178
errors=1
170179
continue
171180
fi
172181

173182
_info "PASS: ${testDir} returned expected results"
174183
done
175184
if [ $errors -ne 0 ]; then
176-
_captureOutput
177185
_fatal "One or more expected results failed. See above ERROR(s) for details."
178186
fi
179187

src/main/java/com/datastax/cdm/feature/WritetimeTTL.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public boolean initializeAndValidate(CqlTable originTable, CqlTable targetTable)
117117
logger.error("Counter table cannot specify TTL or WriteTimestamp columns as they cannot set on write");
118118
isValid = false;
119119
isEnabled = false;
120-
return false;
121120
}
122121

123122
logger.info("Counter table does not support TTL or WriteTimestamp columns as they cannot set on write, so feature is disabled");

src/main/java/com/datastax/cdm/properties/KnownProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ public enum PropertyType {
8585
required.add(ORIGIN_KEYSPACE_TABLE);
8686
types.put(ORIGIN_TTL_NAMES, PropertyType.STRING_LIST);
8787
types.put(ORIGIN_TTL_AUTO, PropertyType.BOOLEAN);
88-
defaults.put(ORIGIN_TTL_AUTO, "false");
88+
defaults.put(ORIGIN_TTL_AUTO, "true");
8989
types.put(ORIGIN_WRITETIME_NAMES, PropertyType.STRING_LIST);
9090
types.put(ORIGIN_WRITETIME_AUTO, PropertyType.BOOLEAN);
91-
defaults.put(ORIGIN_WRITETIME_AUTO, "false");
91+
defaults.put(ORIGIN_WRITETIME_AUTO, "true");
9292
types.put(ORIGIN_COLUMN_NAMES_TO_TARGET, PropertyType.STRING_LIST);
9393
}
9494

0 commit comments

Comments
 (0)