Debian Codegraph @

test/integration/targets/templating/tasks/plugin_errors.yml

raw
1 - name: attempt to use a filter plugin that fails to load
2 raw: echo {{ '' | broken }}
3 ignore_errors: yes
4 register: error
5
6 - assert:
7 that:
8 - error is failed
9 - |
10 error.msg is contains("filter plugin 'broken' failed to load: boom")
11
12 - name: attempt to use a filter plugin that is not found
13 raw: echo {{ '' | nope }}
14 ignore_errors: yes
15 register: error
16
17 - assert:
18 that:
19 - error is failed
20 - error.msg is contains("No filter named 'nope'")
21
22 - name: attempt to use a test plugin that fails to load
23 raw: echo {{ '' is broken }}
24 ignore_errors: yes
25 register: error
26
27 - assert:
28 that:
29 - error is failed
30 - |
31 error.msg is contains("test plugin 'broken' failed to load: boom")
32
33 - name: attempt to use a test plugin that is not found
34 raw: echo {{ '' is nope }}
35 ignore_errors: yes
36 register: error
37
38 - assert:
39 that:
40 - error is failed
41 - error.msg is contains("No test named 'nope'")
42
43 - name: attempt to use a lookup plugin that fails to load
44 raw: echo {{ lookup('broken') }}
45 ignore_errors: yes
46 register: error
47
48 - assert:
49 that:
50 - error is failed
51 - |
52 error.msg is contains("lookup plugin 'broken' failed to load: boom")
53
54 - name: attempt to use a lookup plugin that is not found
55 raw: echo {{ lookup('nope') }}
56 ignore_errors: yes
57 register: error
58
59 - assert:
60 that:
61 - error is failed
62 - error.msg is contains("lookup plugin 'nope' was not found")
63
64 - name: verify plugin errors are captured
65 assert:
66 that:
67 - (syntax_error | ansible._protomatter.dump_object).exception.message is contains "Syntax error in template"
68 - (undef(0) | ansible._protomatter.dump_object).exception.message is contains "argument must be of type"
69 - (lookup('pipe', 'exit 1') | ansible._protomatter.dump_object).exception.message is contains "lookup plugin 'pipe' failed"
70 - ('{' | from_json | ansible._protomatter.dump_object).exception.message is contains "Expecting property name enclosed in double quotes"
71 vars:
72 syntax_error: "{{ #'"