Fix failing unit test
Change-Id: I6a0619c688d29a126d8bf905675a1f899e42fcf3
This commit is contained in:
parent
95db7a7cc0
commit
440bbf9eac
|
@ -314,9 +314,9 @@ class TestCreateCluster(api.APITest,
|
|||
|
||||
data = self.post_json('/clusters', params=api_cluster,
|
||||
headers=self.auth_headers, expect_errors=True)
|
||||
self.assertEqual(500, data.status_code,
|
||||
self.assertEqual(400, data.status_code,
|
||||
'Invalid status code value received.')
|
||||
self.assertEqual('500 Internal Server Error', data.status,
|
||||
self.assertEqual('400 Bad Request', data.status,
|
||||
'Invalid status value received.')
|
||||
self.assertIn('invalid literal for int() with base 10:',
|
||||
data.namespace["faultstring"],
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
# under the License.
|
||||
|
||||
ALLOWED_EXTRA_MISSING=4
|
||||
COVERAGE_PERCENT_THRESHOLD=80
|
||||
|
||||
show_diff () {
|
||||
head -1 $1
|
||||
|
@ -41,6 +42,7 @@ current_report=$(mktemp -t rally_coverageXXXXXXX)
|
|||
python setup.py testr --coverage --testr-args="$*"
|
||||
coverage report > $current_report
|
||||
current_missing=$(awk 'END { print $3 }' $current_report)
|
||||
current_percent_coverage=$(awk 'END { print $6 }' $current_report | tr -d '%')
|
||||
|
||||
# Show coverage details
|
||||
allowed_missing=$((baseline_missing+ALLOWED_EXTRA_MISSING))
|
||||
|
@ -49,7 +51,13 @@ echo "Allowed to introduce missing lines : ${ALLOWED_EXTRA_MISSING}"
|
|||
echo "Missing lines in master : ${baseline_missing}"
|
||||
echo "Missing lines in proposed change : ${current_missing}"
|
||||
|
||||
if [ $allowed_missing -gt $current_missing ];
|
||||
|
||||
if [ -z $baseline_missing ] &&
|
||||
[ $current_percent_coverage -gt $COVERAGE_PERCENT_THRESHOLD ];
|
||||
then
|
||||
echo "Coverage is : ${current_percent_coverage} %"
|
||||
exit_code=0
|
||||
elif [ $allowed_missing -gt $current_missing ];
|
||||
then
|
||||
if [ $baseline_missing -lt $current_missing ];
|
||||
then
|
||||
|
|
Loading…
Reference in New Issue