Skip to content

Commit 12552ce

Browse files
mtreinishDean Troyer
authored andcommitted
Fix subunit collection in functional tests with ostestr>=1.0.0
With the release of os-testr 1.0.0 stestr is used internally and because of that the repository dir and commands to get subunit are different. This commit updates the post-test hook to get the subunit stream if ostestr>=1.0.0 is used. Change-Id: I2cce7f4780ce418398b17a5848def9072372841e
1 parent f63bb18 commit 12552ce

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

openstackclient/tests/functional/post_test_hook.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ function generate_testr_results {
1515
sudo gzip -9 $BASE/logs/testr_results.html
1616
sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
1717
sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
18+
elif [ -f .stestr/0 ]; then
19+
sudo .tox/functional/bin/stestr last --subunit > $WORKSPACE/testrepository.subunit
20+
sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit
21+
sudo .tox/functional/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
22+
sudo gzip -9 $BASE/logs/testrepository.subunit
23+
sudo gzip -9 $BASE/logs/testr_results.html
24+
sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
25+
sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
1826
fi
1927
}
2028

openstackclient/tests/functional/post_test_hook_tips.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ function generate_testr_results {
1919
sudo gzip -9 $BASE/logs/testr_results.html
2020
sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
2121
sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
22+
elif [ -f .stestr/0 ]; then
23+
sudo .tox/functional-tips/bin/stestr last --subunit > $WORKSPACE/testrepository.subunit
24+
sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit
25+
sudo .tox/functional-tips/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
26+
sudo gzip -9 $BASE/logs/testrepository.subunit
27+
sudo gzip -9 $BASE/logs/testr_results.html
28+
sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
29+
sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
2230
fi
2331
}
2432

0 commit comments

Comments
 (0)