-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathtest_run_pack_tests_tool.yaml
More file actions
117 lines (112 loc) · 4.58 KB
/
Copy pathtest_run_pack_tests_tool.yaml
File metadata and controls
117 lines (112 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
vars:
base_repo_url: "https://github.com/StackStorm"
# Note: Pack 1 should have no external dependencies beyond Python stdlib ones.
pack_to_install_1: "csv"
pack_to_install_2: "xml"
pack_to_install_2_with_version: "xml=0.3.0"
test_timeout: 180
chain:
-
name: install_pack_1
ref: core.local
params:
env:
ST2_BASE_URL: "{{protocol}}://{{hostname}}"
ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100"
ST2_API_URL: "{{protocol}}://{{hostname}}:9101"
ST2_AUTH_TOKEN: "{{token}}"
cmd: "st2 pack install {{ pack_to_install_1 }}"
timeout: "{{test_timeout}}"
on-success: test_installed_pack_1_version
on-failure: error_handler
-
name: test_installed_pack_1_version
ref: tests.test_installed_pack_version
params:
installed_pack: "{{ pack_to_install_1 }}"
on-success: install_pack_2
on-failure: error_handler
-
name: install_pack_2
ref: core.local
params:
env:
ST2_BASE_URL: "{{protocol}}://{{hostname}}"
ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100"
ST2_API_URL: "{{protocol}}://{{hostname}}:9101"
ST2_AUTH_TOKEN: "{{token}}"
cmd: "st2 pack install {{ pack_to_install_2_with_version }}"
timeout: "{{test_timeout}}"
on-success: test_installed_pack_2_version
on-failure: error_handler
-
name: test_installed_pack_2_version
ref: tests.test_installed_pack_version
params:
installed_pack: "{{ pack_to_install_2_with_version }}"
on-success: run_pack_tests_without_creating_virtualenv
on-failure: error_handler
-
name: run_pack_tests_without_creating_virtualenv
ref: core.local
params:
env:
ST2_BASE_URL: "{{protocol}}://{{hostname}}"
ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100"
ST2_API_URL: "{{protocol}}://{{hostname}}:9101"
ST2_AUTH_TOKEN: "{{token}}"
cmd: "st2-run-pack-tests -p /opt/stackstorm/packs/{{ pack_to_install_1 }} -x -j"
timeout: "{{test_timeout}}"
on-success: run_pack_tests_using_a_pack_tests_local_virtualenv
on-failure: error_handler
-
name: run_pack_tests_using_a_pack_tests_local_virtualenv
ref: core.local
params:
env:
ST2_BASE_URL: "{{protocol}}://{{hostname}}"
ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100"
ST2_API_URL: "{{protocol}}://{{hostname}}:9101"
ST2_AUTH_TOKEN: "{{token}}"
cmd: "st2-run-pack-tests -p /opt/stackstorm/packs/{{ pack_to_install_2 }}"
timeout: "{{test_timeout}}"
on-success: run_pack_tests_using_existing_pack_local_virtualenv
on-failure: error_handler
-
name: run_pack_tests_using_existing_pack_local_virtualenv
ref: core.local
params:
env:
ST2_BASE_URL: "{{protocol}}://{{hostname}}"
ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100"
ST2_API_URL: "{{protocol}}://{{hostname}}:9101"
ST2_AUTH_TOKEN: "{{token}}"
# Note: Second run should succeed because the previous run created a virtual environment.
# We need to run this as part of the same task because if we run it inside other task,
# /tmp/ directory where virtualenv is created will be deleted by then.
cmd: "st2-run-pack-tests -p /opt/stackstorm/packs/{{ pack_to_install_2 }} && st2-run-pack-tests -p /opt/stackstorm/packs/{{ pack_to_install_2 }} -j"
timeout: "{{test_timeout}}"
on-success: success_handler
on-failure: error_handler
-
name: success_handler
ref: core.local
params:
env:
ST2_BASE_URL: "{{protocol}}://{{hostname}}"
ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100"
ST2_API_URL: "{{protocol}}://{{hostname}}:9101"
ST2_AUTH_TOKEN: "{{token}}"
cmd: "echo st2-run-pack-tests tests succeeded; exit 0"
-
name: error_handler
description: Error handler
ref: "core.local"
params:
env:
ST2_BASE_URL: "{{protocol}}://{{hostname}}"
ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100"
ST2_API_URL: "{{protocol}}://{{hostname}}:9101"
ST2_AUTH_TOKEN: "{{token}}"
cmd: "echo st2-run-pack-tests tests failed; exit 1"