Skip to content

Commit 76eaa12

Browse files
committed
Testing my script to update the README.md file to sync variables of tesat-operator role from defaults/main.yml
Ticket: OSPRH-19423 Add edpm-ansible-molecule-edpm_kernel for being tested when molecule change After doing improvements in molecule CI job process [1][2], the edpm_kernel CI job should be working now. [1] #3421 [2] openstack-k8s-operators/edpm-ansible#1048 Signed-off-by: Daniel Pawlik <[email protected]>
1 parent 0ec3565 commit 76eaa12

File tree

7 files changed

+1014
-349
lines changed

7 files changed

+1014
-349
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ Unless required by applicable law or agreed to in writing, software
2727
distributed under the License is distributed on an "AS IS" BASIS,
2828
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2929
See the License for the specific language governing permissions and
30-
limitations under the License.
30+
limitations under the License.

roles/test_operator/README copy.md

Lines changed: 308 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
# Test operator
2+
3+
Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/test-operator/).
4+
5+
## Generic parameters
6+
<!-- START GENERIC_PARAMETERS -->
7+
* `cifmw_test_operator_artifacts_basedir`: (String) Directory where we will have all test-operator related files. Default value: `{{ cifmw_basedir }}/tests/test_operator` which defaults to `~/ci-framework-data/tests/test_operator`
8+
* `cifmw_test_operator_log_pod_definition`: (Object) The CR definition template for creating the test log pod. Default value:
9+
```
10+
apiVersion: v1
11+
kind: Pod
12+
metadata:
13+
name: "test-operator-logs-pod-{{ run_test_fw }}-{{ test_operator_instance_name }}"
14+
namespace: "{{ cifmw_test_operator_namespace }}"
15+
spec:
16+
containers:
17+
- name: test-operator-logs-container
18+
image: "{{ cifmw_test_operator_logs_image }}"
19+
command: ["sleep"]
20+
args: ["infinity"]
21+
volumeMounts: "{{ _test_operator_volume_mounts }}"
22+
volumes: "{{ _test_operator_volumes }}"
23+
tolerations: "{{ cifmw_test_operator_tolerations | default(omit) }}"
24+
```
25+
* `cifmw_test_operator_stages`: (List) List of dictionaries defining the stages that should be used in the test operator role. List items options are:
26+
* `name`: (String) The name of the stage. The name must be unique.
27+
* `type`: (String) The framework name you would like to call, currently the options are: tempest, ansibletest, horizontest, tobiko.
28+
* `test_vars_file`: (String) Path to the file used for testing, this file should contain the testing params for this stage. Only parameters specific for the controller can be used (Tempest, Ansibletest, Horizontest and Tobiko).
29+
* `test_vars`: (String) Testing parameters for this specific stage if a `test_vars` is used the specified parameters would override the ones in the `test_vars_file`. Only parameters specific for the controller can be used (Tempest, Ansibletest, Horizontest and Tobiko).
30+
> Important note! Generally only the variables with the following structure can be used to override inside a stage: `cifmw_test_operator_[test-operator CR name]_[parameter name]`. For example, these variables cannot be overridden per stage: `cifmw_test_operator_default_registry`, `cifmw_test_operator_default_namespace`, `cifmw_test_operator_default_image_tag`. One exception is `cifmw_test_operator_namespace`, which allows running the testing frameworks in multiple namespaces.
31+
* `pre_test_stage_hooks`: (List) List of pre hooks to run as described [hooks README](https://github.com/openstack-k8s-operators/ci-framework/tree/main/roles/run_hook#hooks-expected-format).
32+
* `post_test_stage_hooks`: (List) List of post hooks to run as described [hooks README](https://github.com/openstack-k8s-operators/ci-framework/tree/main/roles/run_hook#hooks-expected-format).
33+
Default value:
34+
```
35+
cifmw_test_operator_stages:
36+
- name: tempest
37+
type: tempest
38+
```
39+
<!-- END GENERIC_PARAMETERS -->
40+
41+
## Tempest specific parameters
42+
<!-- START TEMPEST_SPECIFIC_PARAMETERS -->
43+
* `cifmw_test_operator_tempest_name`: (String) Value used in the `Tempest.Metadata.Name` field. The value specifies the name of some resources spawned by the test-operator role. Default value: `tempest-tests`
44+
* `cifmw_test_operator_tempest_tempestconf_config`: (Dict) This parameter can be used to customize the execution of the `discover-tempest-config` run. Please consult the test-operator documentation. For example, to pass a custom configuration for `tempest.conf`, use the `overrides` section:
45+
```
46+
cifmw_test_operator_tempest_tempestconf_config:
47+
overrides: |
48+
identity.v3_endpoint_type public
49+
Default value: {}
50+
```
51+
* `cifmw_test_operator_tempest_config`: (Object) Definition of Tempest CRD instance that is passed to the test-operator (see [the test-operator documentation](https://openstack-k8s-operators.github.io/test-operator/crds.html#tempest-custom-resource)). Default value:
52+
```
53+
apiVersion: test.openstack.org/v1beta1
54+
kind: Tempest
55+
metadata:
56+
name: "{{ cifmw_test_operator_tempest_name }}"
57+
namespace: "{{ cifmw_test_operator_namespace }}"
58+
spec:
59+
containerImage: "{{ cifmw_test_operator_tempest_image }}:{{ cifmw_test_operator_tempest_image_tag }}"
60+
storageClass: "{{ cifmw_test_operator_storage_class }}"
61+
tolerations: "{{ cifmw_test_operator_tolerations | default(omit) }}"
62+
nodeSelector: "{{ cifmw_test_operator_node_selector | default(omit) }}"
63+
networkAttachments: "{{ cifmw_test_operator_tempest_network_attachments }}"
64+
tempestRun:
65+
includeList: |
66+
{{ cifmw_test_operator_tempest_include_list | default('') }}
67+
excludeList: |
68+
{{ cifmw_test_operator_tempest_exclude_list | default('') }}
69+
concurrency: "{{ cifmw_test_operator_tempest_concurrency | default(8) }}"
70+
externalPlugin: "{{ cifmw_test_operator_tempest_external_plugin | default([]) }}"
71+
extraRPMs: "{{ cifmw_test_operator_tempest_extra_rpms | default([]) }}"
72+
extraImages: "{{ cifmw_test_operator_tempest_extra_images | default([]) }}"
73+
tempestconfRun: "{{ cifmw_test_operator_tempest_tempestconf_config | default(omit) }}"
74+
debug: "{{ cifmw_test_operator_tempest_debug }}"
75+
```
76+
<!-- END TEMPEST_SPECIFIC_PARAMETERS -->
77+
78+
## Tobiko specific parameters
79+
<!-- START TOBIKO_SPECIFIC_PARAMETERS -->
80+
* `cifmw_test_operator_tobiko_name`: (String) Value used in the `Tobiko.Metadata.Name` field. The value specifies the name of some resources spawned by the test-operator role. Default value: `tobiko-tests`
81+
* `cifmw_test_operator_tobiko_config`: (Dict) Definition of Tobiko CRD instance that is passed to the test-operator (see [the test-operator documentation](https://openstack-k8s-operators.github.io/test-operator/crds.html#tobiko-custom-resource)). Default value:
82+
```
83+
apiVersion: test.openstack.org/v1beta1
84+
kind: Tobiko
85+
metadata:
86+
name: "{{ cifmw_test_operator_tobiko_name }}"
87+
namespace: "{{ cifmw_test_operator_namespace }}"
88+
spec:
89+
kubeconfigSecretName: "{{ cifmw_test_operator_tobiko_kubeconfig_secret }}"
90+
storageClass: "{{ cifmw_test_operator_storage_class }}"
91+
containerImage: "{{ cifmw_test_operator_tobiko_image }}:{{ cifmw_test_operator_tobiko_image_tag }}"
92+
testenv: "{{ cifmw_test_operator_tobiko_testenv }}"
93+
version: "{{ cifmw_test_operator_tobiko_version }}"
94+
pytestAddopts: "{{ cifmw_test_operator_tobiko_pytest_addopts if cifmw_test_operator_tobiko_pytest_addopts is not none else omit }}"
95+
tolerations: "{{ cifmw_test_operator_tolerations | default(omit) }}"
96+
nodeSelector: "{{ cifmw_test_operator_node_selector | default(omit) }}"
97+
networkAttachments: "{{ cifmw_test_operator_tobiko_network_attachments }}"
98+
debug: "{{ cifmw_test_operator_tobiko_debug }}"
99+
# preventCreate: preventCreate is generated by the test_operator role based on the value of cifmw_test_operator_tobiko_prevent_create
100+
# numProcesses: numProcesses is generated by the test_operator role based on the value of cifmw_test_operator_tobiko_num_processes
101+
# privateKey: privateKey is automatically generated by the test_operator role
102+
# publicKey: publicKey is automatically generated by the test_operator role
103+
# config: config is generated combining cifmw_test_operator_tobiko_default_conf and cifmw_test_operator_tobiko_override_conf
104+
workflow: "{{ cifmw_test_operator_tobiko_workflow }}"
105+
```
106+
<!-- END TOBIKO_SPECIFIC_PARAMETERS -->
107+
108+
## AnsibleTest specific parameters
109+
<!-- START ANSIBLETEST_SPECIFIC_PARAMETERS -->
110+
* `cifmw_test_operator_ansibletest_name`: (String) Value used in the `Ansibletest.Metadata.Name` field. The value specifies the name of some resources spawned by the test-operator role. Default value: `ansibletest`
111+
* `cifmw_test_operator_ansibletest_config`: Definition of AnsibleTest CRD instance that is passed to the test-operator (see [the test-operator documentation](https://openstack-k8s-operators.github.io/test-operator/crds.html)). Default value:
112+
```
113+
apiVersion: test.openstack.org/v1beta1
114+
kind: AnsibleTest
115+
metadata:
116+
name: "{{ cifmw_test_operator_ansibletest_name }}"
117+
namespace: "{{ cifmw_test_operator_namespace }}"
118+
spec:
119+
containerImage: "{{ cifmw_test_operator_ansibletest_image }}:{{ cifmw_test_operator_ansibletest_image_tag }}"
120+
extraConfigmapsMounts: "{{ cifmw_test_operator_ansibletest_extra_configmaps_mounts }}"
121+
storageClass: "{{ cifmw_test_operator_storage_class }}"
122+
computeSSHKeySecretName: "{{ cifmw_test_operator_ansibletest_compute_ssh_key_secret_name }}"
123+
workloadSSHKeySecretName: "{{ cifmw_test_operator_ansibletest_workload_ssh_key_secret_name }}"
124+
ansibleGitRepo: "{{ cifmw_test_operator_ansibletest_ansible_git_repo }}"
125+
ansiblePlaybookPath: "{{ cifmw_test_operator_ansibletest_ansible_playbook_path }}"
126+
ansibleCollections: "{{ cifmw_test_operator_ansibletest_ansible_collection }}"
127+
ansibleVarFiles: "{{ cifmw_test_operator_ansibletest_ansible_var_files }}"
128+
ansibleExtraVars: "{{ cifmw_test_operator_ansibletest_ansible_extra_vars }}"
129+
ansibleInventory: "{{ cifmw_test_operator_ansibletest_ansible_inventory }}"
130+
openStackConfigMap: "{{ cifmw_test_operator_ansibletest_openstack_config_map }}"
131+
openStackConfigSecret: "{{ cifmw_test_operator_ansibletest_openstack_config_secret }}"
132+
workflow: "{{ cifmw_test_operator_ansibletest_workflow }}"
133+
debug: "{{ cifmw_test_operator_ansibletest_debug }}"
134+
```
135+
<!-- END ANSIBLETEST_SPECIFIC_PARAMETERS -->
136+
137+
## Horizontest specific parameters
138+
<!-- START HORIZONTEST_SPECIFIC_PARAMETERS -->
139+
* `cifmw_test_operator_horizontest_name`: (String) Value used in the `Horizontest.Metadata.Name` field. The value specifies the name of some resources spawned by the test-operator role. Default value: `horizontest-tests`
140+
* `cifmw_test_operator_horizontest_config`: (Dict) Definition of HorizonTest CR instance that is passed to the test-operator (see [the test-operator documentation](https://openstack-k8s-operators.github.io/test-operator/crds.html#horizontest-custom-resource)). Default value:
141+
```
142+
apiVersion: test.openstack.org/v1beta1
143+
kind: HorizonTest
144+
metadata:
145+
name: "{{ cifmw_test_operator_horizontest_name }}"
146+
namespace: "{{ cifmw_test_operator_namespace }}"
147+
spec:
148+
containerImage: "{{ cifmw_test_operator_horizontest_image }}:{{ cifmw_test_operator_horizontest_image_tag }}"
149+
adminUsername: "{{ cifmw_test_operator_horizontest_admin_username }}"
150+
adminPassword: "{{ cifmw_test_operator_horizontest_admin_password }}"
151+
dashboardUrl: "{{ cifmw_test_operator_horizontest_dashboard_url }}"
152+
authUrl: "{{ cifmw_test_operator_horizontest_auth_url }}"
153+
repoUrl: "{{ cifmw_test_operator_horizontest_repo_url }}"
154+
horizonRepoBranch: "{{ cifmw_test_operator_horizontest_horizon_repo_branch }}"
155+
imageUrl: "{{ cifmw_test_operator_horizontest_image_url }}"
156+
projectName: "{{ cifmw_test_operator_horizontest_project_name }}"
157+
user: "{{ cifmw_test_operator_horizontest_user }}"
158+
password: "{{ cifmw_test_operator_horizontest_password }}"
159+
flavorName: "{{ cifmw_test_operator_horizontest_flavor_name }}"
160+
logsDirectoryName: "{{ cifmw_test_operator_horizontest_logs_directory_name }}"
161+
debug: "{{ cifmw_test_operator_horizontest_debug }}"
162+
extraFlag: "{{ cifmw_test_operator_horizontest_extra_flag }}"
163+
projectNameXpath "{{ cifmw_test_operator_horizontest_project_name_xpath }}"
164+
horizonTestDir: "{{ cifmw_test_operator_horizontest_horizon_test_dir }}"
165+
```
166+
<!-- END HORIZONTEST_SPECIFIC_PARAMETERS -->
167+
168+
## Examples
169+
170+
### Execute the `test-operator` role multiple times within a single job
171+
172+
If you want to run the `test-operator` role twice within a single job, make sure
173+
that for the second run, you specify a value for the `cifmw_test_operator_*_name`
174+
other than the default one (e.g., `tempest-tests`, `tobiko-tests`, ...):
175+
176+
```
177+
cifmw_test_operator_tempest_name: "post-update-tempest-tests"
178+
```
179+
180+
### Use test operator stages
181+
Test operator stages are meant to allow setting the order of stages,running stages
182+
of the same controller multiple times and using different hooks,vars and names for stages.
183+
```
184+
cifmw_test_operator_stages:
185+
- name: basic-functionallity
186+
type: tempest
187+
test_vars:
188+
cifmw_test_operator_tempest_name: 'basic-functionality-tests'
189+
- name: ansibletest
190+
type: ansibletest
191+
- name: advanced-tests
192+
type: tempest
193+
test_vars:
194+
cifmw_test_operator_tempest_name: 'advanced-tests'
195+
- name: tobiko
196+
type: tobiko
197+
test_vars_file: /path/to/tobiko/override/test/file
198+
```

0 commit comments

Comments
 (0)