File tree Expand file tree Collapse file tree 6 files changed +441
-2
lines changed Expand file tree Collapse file tree 6 files changed +441
-2
lines changed Original file line number Diff line number Diff line change 27
27
ansible-lint -v --force-color
28
28
antsibull-changelog lint
29
29
30
- ansible-test-sanity :
30
+ ansible-test :
31
31
runs-on : ubuntu-latest
32
32
strategy :
33
33
fail-fast : false
53
53
run : |
54
54
ansible-test sanity --verbose --docker --junit
55
55
56
+ - name : Run ansible-test units
57
+ working-directory : ansible_collections/stackhpc/cephadm
58
+ run : |
59
+ ansible-test units --verbose --docker --coverage
60
+ ansible-test coverage xml
61
+
56
62
- name : Publish Test Report
57
63
uses : mikepenz/action-junit-report@v3
58
64
if : success() || failure() # always run even if the previous step fails
59
65
with :
60
- report_paths : ' **/tests/output/junit /*.xml'
66
+ report_paths : ' **/tests/output/* /*.xml'
Original file line number Diff line number Diff line change
1
+ # antsibull-changelog cache
1
2
/changelogs /.plugin-cache.yaml
3
+
4
+ # ansible-test output
2
5
/tests /output
6
+
7
+ # Byte-compiled / optimized / DLL files
8
+ __pycache__ /
9
+ * .py [cod ]
10
+ * $py.class
Original file line number Diff line number Diff line change 1
1
ansible>=2.9
2
2
ansible-lint<7
3
3
antsibull-changelog
4
+ coverage<=6.5.0
5
+ mock
6
+ pytest
7
+ pytest-forked
8
+ pytest-xdist
Original file line number Diff line number Diff line change
1
+ from ansible .module_utils import basic
2
+ from ansible .module_utils ._text import to_bytes
3
+ import json
4
+
5
+
6
+ def set_module_args (args ):
7
+ if '_ansible_remote_tmp' not in args :
8
+ args ['_ansible_remote_tmp' ] = '/tmp'
9
+ if '_ansible_keep_remote_files' not in args :
10
+ args ['_ansible_keep_remote_files' ] = False
11
+
12
+ args = json .dumps ({'ANSIBLE_MODULE_ARGS' : args })
13
+ basic ._ANSIBLE_ARGS = to_bytes (args )
14
+
15
+
16
+ class AnsibleExitJson (Exception ):
17
+ pass
18
+
19
+
20
+ class AnsibleFailJson (Exception ):
21
+ pass
22
+
23
+
24
+ def exit_json (* args , ** kwargs ):
25
+ raise AnsibleExitJson (kwargs )
26
+
27
+
28
+ def fail_json (* args , ** kwargs ):
29
+ raise AnsibleFailJson (kwargs )
You can’t perform that action at this time.
0 commit comments