Conversation
| # It's up! | ||
| # Run integration test | ||
| echo "Running integration test" | ||
| int_test=$(./cdr_cass_integration_test.sh "$container_name" 2>&1) |
There was a problem hiding this comment.
Why did you change this?
On the lines above we create and start a cassandra container on port 9043 so we can run the tests without having to manually start cassandra as well as not having to shut down cassandra if it is already running on your local machine. This breaks it.
test/cdr_cass_integration_test.sh
Outdated
| # Finally, run the jar. | ||
| # Run with timeout | ||
| timeout $timeout java -Dnetty.epoll.enabled=false -Dconfig.file=$(basename "$app_conf_path") -jar "$jar_directory" | ||
| pwd |
test/cdr_cass_integration_test.sh
Outdated
| select count(*) from $cassandra_cdr_table_name; | ||
| EOF | ||
|
|
||
| #$cassandra_cdr_table_name; |
test/dbcIntegrationTest.sh
Outdated
| # back to the directory you were in at start | ||
| popd | ||
|
|
||
| #now run curl to check if the data is at graphite. in this case we are lookng att callplan |
There was a problem hiding this comment.
Grammar/Spelling
Please use quotes for referencing speficic things here. we are looking for the product "CallPlanNormal"
test/dbcIntegrationTest.sh
Outdated
|
|
||
| #check if the file contain data by | ||
| # Read from file and grep for rows. | ||
| #echo ${grep -Fxq "\[\]" $tempGraphiteFile} |
| fi | ||
|
|
||
| #now remove the temp file | ||
| rm -f $tempGraphiteFile |
There was a problem hiding this comment.
Why -f? this can be abused. Remove -f.
| # It's up! | ||
| # Run integration test | ||
| echo "Running integration test" | ||
| int_test=$(./cdr_cass_integration_test.sh "$container_name" 2>&1) |
test/cdr_cass_integration_test.sh
Outdated
| batch_size_limit="cassandra\.element\.batch\.size" | ||
| cassandra_port="port" | ||
| cassandra_it_port=9043 | ||
| cassandra_it_port=9042 |
test/dbcIntegrationTest.sh
Outdated
| #now run curl to check if the data is at graphite. in this case we are lookng att callplan | ||
| curl '127.0.0.1:2000/render?target=qvantel.product.voice.CallPlanNormal&format=json' -o $tempGraphiteFile | ||
|
|
||
| #check if the file contain data by |
There was a problem hiding this comment.
Inconsistent comment whitespace. The next comment uses
# Comment and this one uses #Comment. Use the first one.
| if grep -Fxq "[]" $tempGraphiteFile | ||
| then | ||
| #there are no records in this file | ||
| echo "the dbconnector integration test failed!" |
test/cdr_cass_integration_test.sh
Outdated
| # Finally, run the jar. | ||
| # Run with timeout | ||
| timeout $timeout java -Dnetty.epoll.enabled=false -Dconfig.file=$(basename "$app_conf_path") -jar "$jar_directory" | ||
| pwd |
test/cdr_cass_integration_test.sh
Outdated
| select count(*) from $cassandra_cdr_table_name; | ||
| EOF | ||
|
|
||
| #$cassandra_cdr_table_name; |
There was a problem hiding this comment.
This comment provides nothing
| # use head and tail to get the first and last. | ||
| has_records_cdr=$(echo "$has_records" | head -n+1) | ||
|
|
||
| # |
| # cleanup | ||
| if [ -f "$temp_cassandra_result_file" ] | ||
| then | ||
| echo "Removed temp file" |
There was a problem hiding this comment.
Why switch all 4 space identations to 3 space identations?
test/dbcIntegrationTest.sh
Outdated
| #!/bin/bash | ||
|
|
||
| app_conf_path="src/main/resources/application.conf" | ||
| limit="theLimit" |
| popd | ||
|
|
||
| #now run curl to check if the data is at graphite. in this case we are looking for "callplanNormal" | ||
| curl '127.0.0.1:2090/render?target=qvantel.product.voice.CallPlanNormal&format=json' -o $tempGraphiteFile |
There was a problem hiding this comment.
Please set variables for IP and port
| if grep -Fxq "[]" $tempGraphiteFile | ||
| then | ||
| #there are no records in this file | ||
| echo "the dbconnector integration test failed!" |
| then | ||
| #there are no records in this file | ||
| echo "the dbconnector integration test failed!" | ||
| echo "[-failed-]" |
There was a problem hiding this comment.
You need to set a non-zero exit code upon fail, otherwise travis will not report this as a failed test.
If you do cleanup in the end of this file you most likely want to set a variable with the exit code and to "exit $myvar" in the end
There was a problem hiding this comment.
Saw that you later in integration.sh use grep on this text.
Sure it works but it is very bad and can easily break, so please fix anyway.
| if [ -n "$(echo $int_test | grep '[SUCCESS]')" ] && [ $code -eq 0 ] | ||
| then | ||
| echo "Integration test successful" | ||
| exit 0 |
There was a problem hiding this comment.
Why remove exit 0?
pair programmed with @Jozo95 results
-add a new dbconnector integration test file.
-updated integration file so that it runs integration test from cdr to graphite "all the way up".