tripleo-quickstart-extras/roles/validate-tempest/templates/run-tempest.sh.j2

48 lines
1.8 KiB
Django/Jinja

### --start_docs
## Run tempest
## -----------
## ::
## FIXME(chkumar246): Tempest run interface is unstable till that use ostestr for
## running tests: https://bugs.launchpad.net/tempest/+bug/1669455
{% if tempest_format == "venv" %}
export OSTESTR='{{ working_dir }}/tempest_git/tools/with_venv.sh ostestr --regex'
export S2JXML='{{ working_dir }}/tempest_git/tools/with_venv.sh subunit2junitxml --output-to=tempest.xml'
export SUBUNIT='{{ working_dir }}/tempest_git/tools/with_venv.sh subunit-trace --no-failure-debug -f'
export TEMPESTCLI='{{ working_dir }}/tempest_git/tools/with_venv.sh tempest'
## List Tests
{{ working_dir }}/tempest_git/tools/with_venv.sh ostestr -l
{% elif tempest_format == "packages" %}
export OSTESTR='ostestr --regex'
export S2JXML='subunit2junitxml --output-to=tempest.xml'
export SUBUNIT='subunit-trace --no-failure-debug -f'
export TEMPESTCLI='/usr/bin/tempest'
ostestr -l
{% endif %}
## List tempest plugins
$TEMPESTCLI list-plugins
## Save the resources before running tempest tests
## It will create saved_state.json in tempest workspace.
{% if tempest_track_resources|bool %}
$TEMPESTCLI cleanup --init-saved-state
{% endif %}
( $OSTESTR '({{ test_regex }})' --no-pretty --subunit {% if skip_file_src != '' %}--blacklist_file={{ working_dir }}/{{ skip_file }}{% endif %}
{% if tempest_workers is defined %} --concurrency {{ tempest_workers }} {% endif %}
{% if tempest_tests_file is defined %} --load-list={{ tempest_tests_file }} {% endif %}
{% if tempest_until_failure|bool %} --until-failure {% endif %}
) | tee >( $S2JXML ) | $SUBUNIT
## Check which all tenants would be modified in the tempest run
## It will create dry_run.json in tempest workspace.
{% if tempest_track_resources|bool %}
$TEMPESTCLI cleanup --dry-run
{% endif %}
### --stop_docs