Browse Source

Fix post gate hook to accommodate for new os-testr

New os-testr uses stestr under the hood, which creates .stestr but not
.testrepository directory in the current dir. Other than that, it
doesn't seem like there is any difference in the format or names of
files generated in the directory.

Change-Id: I82d52bf0ad885bd36d2f0782a7c86ac61df532f2
Closes-Bug: #1716746
changes/38/503138/3
Ihar Hrachyshka 4 years ago
parent
commit
3e341a9941
5 changed files with 11 additions and 8 deletions
  1. +1
    -0
      .gitignore
  2. +3
    -0
      .stestr.conf
  3. +5
    -5
      neutron/tests/contrib/post_test_hook.sh
  4. +2
    -2
      run_tests.sh
  5. +0
    -1
      test-requirements.txt

+ 1
- 0
.gitignore View File

@ -26,6 +26,7 @@ setuptools*.egg/
!/.gitreview
!/.mailmap
!/.pylintrc
!/.stestr.conf
!/.testr.conf
# Files created by releasenotes build


+ 3
- 0
.stestr.conf View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./neutron/tests/unit}
top_dir=./

+ 5
- 5
neutron/tests/contrib/post_test_hook.sh View File

@ -10,11 +10,11 @@ venv=${1:-"dsvm-functional"}
function generate_testr_results {
# Give job user rights to access tox logs
sudo -H -u $owner chmod o+rw .
sudo -H -u $owner chmod o+rw -R .testrepository
if [ -f ".testrepository/0" ] ; then
.tox/$venv/bin/subunit-1to2 < .testrepository/0 > ./testrepository.subunit
$SCRIPTS_DIR/subunit2html ./testrepository.subunit testr_results.html
gzip -9 ./testrepository.subunit
sudo -H -u $owner chmod o+rw -R .stestr
if [ -f ".stestr/0" ] ; then
.tox/$venv/bin/subunit-1to2 < .stestr/0 > ./stestr.subunit
$SCRIPTS_DIR/subunit2html ./stestr.subunit testr_results.html
gzip -9 ./stestr.subunit
gzip -9 ./testr_results.html
sudo mv ./*.gz /opt/stack/logs/
fi


+ 2
- 2
run_tests.sh View File

@ -168,9 +168,9 @@ function run_tests {
}
function copy_subunit_log {
LOGNAME=`cat .testrepository/next-stream`
LOGNAME=`cat .stestr/next-stream`
LOGNAME=$(($LOGNAME - 1))
LOGNAME=".testrepository/${LOGNAME}"
LOGNAME=".stestr/${LOGNAME}"
cp $LOGNAME subunit.log
}


+ 0
- 1
test-requirements.txt View File

@ -12,7 +12,6 @@ python-subunit>=0.0.18 # Apache-2.0/BSD
sphinx>=1.6.2 # BSD
openstackdocstheme>=1.16.0 # Apache-2.0
oslosphinx>=4.7.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
testtools>=1.4.0 # MIT
testresources>=0.2.4 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD


Loading…
Cancel
Save