Skip to content

Commit

Permalink
Fix handling of .stestr caching for linux py37 job (#7053)
Browse files Browse the repository at this point in the history
In the linux py37 CI job ever since #6175 we build an sdist and then
install that in a venv manually in a test /tmp directory we create for
running the tests. However, as part of that we were handling the .stestr
history caching incorrectly. We cache the .stestr directory's times.dbm
files (which contain a record of the most recent run time for each test)
to provide scheduler hints to stest in future runs. But, instead of
updating the .stestr cache with the data from the run we were just
re-populating the data we pulled from the cache. This has also been
somewhat error prone because in some cases the cache isn't downloaded
correctly and will cause an error when we try to remove unecessary files
from the cache and the .stestr directory doesn't exist, presumably
because azure didn't pull it from the cache correctly. This commit fixes
the issue by updating the generate results post processing step to
correctly copy the most recent data to the cached path after the run.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mtreinish and mergify[bot] authored Sep 21, 2021
1 parent 123a0a7 commit 80e6ca5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ stages:
mkdir -p /tmp/terra-tests
cp -r test /tmp/terra-tests/.
cp .stestr.conf /tmp/terra-tests/.
cp -r .stestr /tmp/terra-tests/. || :
sudo apt install -y graphviz
pip check
displayName: 'Install dependencies'
Expand Down Expand Up @@ -225,11 +226,12 @@ stages:
pushd /tmp/terra-tests
mkdir -p junit
stestr last --subunit | ./subunit_to_junit.py -o junit/test-results.xml
popd
cp -r /tmp/terra-tests/junit .
pushd .stestr
ls | grep -P "^\d" | xargs -d "\n" rm -f
popd
popd
cp -r /tmp/terra-tests/junit .
cp -r /tmp/terra-tests/.stestr .
condition: succeededOrFailed()
displayName: 'Generate results'
- task: PublishTestResults@2
Expand Down

0 comments on commit 80e6ca5

Please sign in to comment.