Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 1 | {# Collection of sl tests macroses shared across different deployments #} |
| 2 | |
| 3 | {% set SL_TEST_BRANCH = os_env('SL_TEST_BRANCH','master') %} |
Dmitry Kalashnik | b17ac3d | 2018-04-06 17:37:57 +0400 | [diff] [blame] | 4 | {% set SL_TEST_REPO = os_env('SL_TEST_REPO','https://github.com/Mirantis/stacklight-pytest') %} |
vitalygusev | 0e57ef6 | 2018-11-30 12:13:56 +0400 | [diff] [blame] | 5 | {% set SL_TEST_TO_RUN = os_env('set SL_TEST_TO_RUN','stacklight_tests/tests/test_smoke.py') %} |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 6 | |
| 7 | {%- macro MACRO_CLONE_SL_TESTS() %} |
| 8 | {############################################################} |
Dennis Dmitriev | d788311 | 2018-01-18 00:50:56 +0200 | [diff] [blame] | 9 | - description: Install stacklight-pytest into virlual environemnt |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 10 | cmd: | |
| 11 | set -e; |
Tatyana Leontovich | 06daf1c | 2018-12-19 18:56:48 +0200 | [diff] [blame] | 12 | apt-get install -y build-essential python-dev virtualenv; |
Dennis Dmitriev | d788311 | 2018-01-18 00:50:56 +0200 | [diff] [blame] | 13 | apt-get -y install python-virtualenv; |
Dmitry Kalashnik | f90ea4c | 2018-04-11 16:30:00 +0400 | [diff] [blame] | 14 | virtualenv --system-site-packages venv-stacklight-pytest; |
Dennis Dmitriev | d788311 | 2018-01-18 00:50:56 +0200 | [diff] [blame] | 15 | . venv-stacklight-pytest/bin/activate; |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 16 | git clone -b {{ SL_TEST_BRANCH }} {{ SL_TEST_REPO }} /root/stacklight-pytest; |
Dennis Dmitriev | d788311 | 2018-01-18 00:50:56 +0200 | [diff] [blame] | 17 | pip install /root/stacklight-pytest; |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 18 | node_name: {{ HOSTNAME_CFG01 }} |
| 19 | retry: {count: 1, delay: 1} |
| 20 | skip_fail: false |
| 21 | {%- endmacro %} |
| 22 | |
| 23 | |
| 24 | {%- macro MACRO_CONFIGURE_TESTS() %} |
| 25 | {#######################################################} |
| 26 | - description: Configure tests |
| 27 | cmd: | |
| 28 | set -e; |
Dennis Dmitriev | d788311 | 2018-01-18 00:50:56 +0200 | [diff] [blame] | 29 | . venv-stacklight-pytest/bin/activate; |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 30 | stl-tests gen-config-mk; |
Dennis Dmitriev | d788311 | 2018-01-18 00:50:56 +0200 | [diff] [blame] | 31 | cp venv-stacklight-pytest/lib/python2.7/site-packages/stacklight_tests/fixtures/config.yaml /root/stacklight-pytest/stacklight_tests/fixtures/config.yaml; |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 32 | node_name: {{ HOSTNAME_CFG01 }} |
| 33 | retry: {count: 1, delay: 1} |
| 34 | skip_fail: false |
| 35 | {%- endmacro %} |