Skip to content

Commit 90990e6

Browse files
committed
Add very basic integration tests for BI modules.
1 parent 72e64f8 commit 90990e6

File tree

14 files changed

+701
-3
lines changed

14 files changed

+701
-3
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# README:
2+
# - When changing the module name, it needs to be changed in 'env:MODULE_NAME' and in 'on:pull_requests:path'!
3+
#
4+
# Resources:
5+
# - Template for this file: https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml
6+
# - About Ansible integration tests: https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html
7+
8+
env:
9+
NAMESPACE: checkmk
10+
COLLECTION_NAME: general
11+
MODULE_NAME: lookup_bi_aggregation
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
name: Ansible Integration Tests for the BI Aggregation Lookup Module
18+
on:
19+
workflow_dispatch:
20+
pull_request:
21+
branches:
22+
- main
23+
- devel
24+
paths:
25+
- 'plugins/lookup/bi_aggregation.py'
26+
push:
27+
paths:
28+
- 'plugins/lookup/bi_aggregation.py'
29+
- '.github/workflows/ans-int-test-lkp-bi_aggregation.yaml'
30+
31+
jobs:
32+
33+
integration:
34+
runs-on: ubuntu-22.04
35+
name: Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
ansible:
40+
- stable-2.15
41+
- stable-2.16
42+
- stable-2.17
43+
- devel
44+
python:
45+
- '3.9'
46+
- '3.10'
47+
- '3.11'
48+
- '3.12'
49+
exclude:
50+
# Exclude unsupported sets.
51+
- ansible: stable-2.15
52+
python: '3.12'
53+
- ansible: stable-2.16
54+
python: '3.9'
55+
- ansible: stable-2.17
56+
python: '3.9'
57+
- ansible: devel
58+
python: '3.9'
59+
- ansible: devel
60+
python: '3.10'
61+
62+
services:
63+
ancient_cre:
64+
image: checkmk/check-mk-raw:2.2.0p42
65+
ports:
66+
- 5022:5000
67+
env:
68+
CMK_SITE_ID: "ancient_cre"
69+
CMK_PASSWORD: "Sup3rSec4et!"
70+
old_cre:
71+
image: checkmk/check-mk-raw:2.3.0p33
72+
ports:
73+
- 5023:5000
74+
env:
75+
CMK_SITE_ID: "old_cre"
76+
CMK_PASSWORD: "Sup3rSec4et!"
77+
old_cme:
78+
image: checkmk/check-mk-managed:2.3.0p33
79+
ports:
80+
- 5323:5000
81+
env:
82+
CMK_SITE_ID: "old_cme"
83+
CMK_PASSWORD: "Sup3rSec4et!"
84+
stable_cre:
85+
image: checkmk/check-mk-raw:2.4.0p2
86+
ports:
87+
- 5024:5000
88+
env:
89+
CMK_SITE_ID: "stable_cre"
90+
CMK_PASSWORD: "Sup3rSec4et!"
91+
stable_cme:
92+
image: checkmk/check-mk-managed:2.4.0p2
93+
ports:
94+
- 5324:5000
95+
env:
96+
CMK_SITE_ID: "stable_cme"
97+
CMK_PASSWORD: "Sup3rSec4et!"
98+
99+
steps:
100+
- name: Check out code
101+
uses: actions/checkout@v4
102+
with:
103+
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
104+
105+
- name: Set up Python
106+
uses: actions/setup-python@v5
107+
with:
108+
python-version: ${{ matrix.python }}
109+
110+
- name: Install ansible-base (${{ matrix.ansible }})
111+
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
112+
113+
- name: Provide secrets file
114+
run: echo "${{ secrets.CHECKMK_DOWNLOAD_PW }}" > ./tests/integration/files/.dl-secret
115+
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
116+
env:
117+
CHECKMK_DOWNLOAD_PW: ${{ secrets.CHECKMK_DOWNLOAD_PW }}
118+
119+
- name: Run integration test
120+
run: ansible-test integration ${{env.MODULE_NAME}} -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }}
121+
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# README:
2+
# - When changing the module name, it needs to be changed in 'env:MODULE_NAME' and in 'on:pull_requests:path'!
3+
#
4+
# Resources:
5+
# - Template for this file: https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml
6+
# - About Ansible integration tests: https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html
7+
8+
env:
9+
NAMESPACE: checkmk
10+
COLLECTION_NAME: general
11+
MODULE_NAME: lookup_bi_pack
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
name: Ansible Integration Tests for the BI Pack Lookup Module
18+
on:
19+
workflow_dispatch:
20+
pull_request:
21+
branches:
22+
- main
23+
- devel
24+
paths:
25+
- 'plugins/lookup/bi_pack.py'
26+
push:
27+
paths:
28+
- 'plugins/lookup/bi_pack.py'
29+
- '.github/workflows/ans-int-test-lkp-bi_pack.yaml'
30+
31+
jobs:
32+
33+
integration:
34+
runs-on: ubuntu-22.04
35+
name: Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
ansible:
40+
- stable-2.15
41+
- stable-2.16
42+
- stable-2.17
43+
- devel
44+
python:
45+
- '3.9'
46+
- '3.10'
47+
- '3.11'
48+
- '3.12'
49+
exclude:
50+
# Exclude unsupported sets.
51+
- ansible: stable-2.15
52+
python: '3.12'
53+
- ansible: stable-2.16
54+
python: '3.9'
55+
- ansible: stable-2.17
56+
python: '3.9'
57+
- ansible: devel
58+
python: '3.9'
59+
- ansible: devel
60+
python: '3.10'
61+
62+
services:
63+
ancient_cre:
64+
image: checkmk/check-mk-raw:2.2.0p42
65+
ports:
66+
- 5022:5000
67+
env:
68+
CMK_SITE_ID: "ancient_cre"
69+
CMK_PASSWORD: "Sup3rSec4et!"
70+
old_cre:
71+
image: checkmk/check-mk-raw:2.3.0p33
72+
ports:
73+
- 5023:5000
74+
env:
75+
CMK_SITE_ID: "old_cre"
76+
CMK_PASSWORD: "Sup3rSec4et!"
77+
old_cme:
78+
image: checkmk/check-mk-managed:2.3.0p33
79+
ports:
80+
- 5323:5000
81+
env:
82+
CMK_SITE_ID: "old_cme"
83+
CMK_PASSWORD: "Sup3rSec4et!"
84+
stable_cre:
85+
image: checkmk/check-mk-raw:2.4.0p2
86+
ports:
87+
- 5024:5000
88+
env:
89+
CMK_SITE_ID: "stable_cre"
90+
CMK_PASSWORD: "Sup3rSec4et!"
91+
stable_cme:
92+
image: checkmk/check-mk-managed:2.4.0p2
93+
ports:
94+
- 5324:5000
95+
env:
96+
CMK_SITE_ID: "stable_cme"
97+
CMK_PASSWORD: "Sup3rSec4et!"
98+
99+
steps:
100+
- name: Check out code
101+
uses: actions/checkout@v4
102+
with:
103+
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
104+
105+
- name: Set up Python
106+
uses: actions/setup-python@v5
107+
with:
108+
python-version: ${{ matrix.python }}
109+
110+
- name: Install ansible-base (${{ matrix.ansible }})
111+
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
112+
113+
- name: Provide secrets file
114+
run: echo "${{ secrets.CHECKMK_DOWNLOAD_PW }}" > ./tests/integration/files/.dl-secret
115+
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
116+
env:
117+
CHECKMK_DOWNLOAD_PW: ${{ secrets.CHECKMK_DOWNLOAD_PW }}
118+
119+
- name: Run integration test
120+
run: ansible-test integration ${{env.MODULE_NAME}} -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }}
121+
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# README:
2+
# - When changing the module name, it needs to be changed in 'env:MODULE_NAME' and in 'on:pull_requests:path'!
3+
#
4+
# Resources:
5+
# - Template for this file: https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml
6+
# - About Ansible integration tests: https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html
7+
8+
env:
9+
NAMESPACE: checkmk
10+
COLLECTION_NAME: general
11+
MODULE_NAME: lookup_bi_rule
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
name: Ansible Integration Tests for the BI Rule Lookup Module
18+
on:
19+
workflow_dispatch:
20+
pull_request:
21+
branches:
22+
- main
23+
- devel
24+
paths:
25+
- 'plugins/lookup/bi_rule.py'
26+
push:
27+
paths:
28+
- 'plugins/lookup/bi_rule.py'
29+
- '.github/workflows/ans-int-test-lkp-bi_rule.yaml'
30+
31+
jobs:
32+
33+
integration:
34+
runs-on: ubuntu-22.04
35+
name: Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
ansible:
40+
- stable-2.15
41+
- stable-2.16
42+
- stable-2.17
43+
- devel
44+
python:
45+
- '3.9'
46+
- '3.10'
47+
- '3.11'
48+
- '3.12'
49+
exclude:
50+
# Exclude unsupported sets.
51+
- ansible: stable-2.15
52+
python: '3.12'
53+
- ansible: stable-2.16
54+
python: '3.9'
55+
- ansible: stable-2.17
56+
python: '3.9'
57+
- ansible: devel
58+
python: '3.9'
59+
- ansible: devel
60+
python: '3.10'
61+
62+
services:
63+
ancient_cre:
64+
image: checkmk/check-mk-raw:2.2.0p42
65+
ports:
66+
- 5022:5000
67+
env:
68+
CMK_SITE_ID: "ancient_cre"
69+
CMK_PASSWORD: "Sup3rSec4et!"
70+
old_cre:
71+
image: checkmk/check-mk-raw:2.3.0p33
72+
ports:
73+
- 5023:5000
74+
env:
75+
CMK_SITE_ID: "old_cre"
76+
CMK_PASSWORD: "Sup3rSec4et!"
77+
old_cme:
78+
image: checkmk/check-mk-managed:2.3.0p33
79+
ports:
80+
- 5323:5000
81+
env:
82+
CMK_SITE_ID: "old_cme"
83+
CMK_PASSWORD: "Sup3rSec4et!"
84+
stable_cre:
85+
image: checkmk/check-mk-raw:2.4.0p2
86+
ports:
87+
- 5024:5000
88+
env:
89+
CMK_SITE_ID: "stable_cre"
90+
CMK_PASSWORD: "Sup3rSec4et!"
91+
stable_cme:
92+
image: checkmk/check-mk-managed:2.4.0p2
93+
ports:
94+
- 5324:5000
95+
env:
96+
CMK_SITE_ID: "stable_cme"
97+
CMK_PASSWORD: "Sup3rSec4et!"
98+
99+
steps:
100+
- name: Check out code
101+
uses: actions/checkout@v4
102+
with:
103+
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
104+
105+
- name: Set up Python
106+
uses: actions/setup-python@v5
107+
with:
108+
python-version: ${{ matrix.python }}
109+
110+
- name: Install ansible-base (${{ matrix.ansible }})
111+
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
112+
113+
- name: Provide secrets file
114+
run: echo "${{ secrets.CHECKMK_DOWNLOAD_PW }}" > ./tests/integration/files/.dl-secret
115+
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
116+
env:
117+
CHECKMK_DOWNLOAD_PW: ${{ secrets.CHECKMK_DOWNLOAD_PW }}
118+
119+
- name: Run integration test
120+
run: ansible-test integration ${{env.MODULE_NAME}} -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }}
121+
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

0 commit comments

Comments
 (0)