| {# Collection of sl tests macroses shared across different deployments #} |
| |
| {% set SL_TEST_BRANCH = os_env('SL_TEST_BRANCH','master') %} |
| {% set SL_TEST_REPO = os_env('SL_TEST_REPO','https://github.com/Mirantis/stacklight-pytest') %} |
| {% set SL_TEST_TO_RUN = os_env('set SL_TEST_TO_RUN','stacklight_tests/tests/test_smoke.py') %} |
| |
| {%- macro MACRO_CLONE_SL_TESTS() %} |
| {############################################################} |
| - description: Install stacklight-pytest into virlual environemnt |
| cmd: | |
| set -e; |
| apt-get install -y build-essential python-dev virtualenv; |
| apt-get -y install python-virtualenv; |
| virtualenv --system-site-packages venv-stacklight-pytest; |
| . venv-stacklight-pytest/bin/activate; |
| git clone -b {{ SL_TEST_BRANCH }} {{ SL_TEST_REPO }} /root/stacklight-pytest; |
| pip install /root/stacklight-pytest; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| {%- endmacro %} |
| |
| |
| {%- macro MACRO_CONFIGURE_TESTS() %} |
| {#######################################################} |
| - description: Configure tests |
| cmd: | |
| set -e; |
| . venv-stacklight-pytest/bin/activate; |
| stl-tests gen-config-mk; |
| cp venv-stacklight-pytest/lib/python2.7/site-packages/stacklight_tests/fixtures/config.yaml /root/stacklight-pytest/stacklight_tests/fixtures/config.yaml; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| {%- endmacro %} |