Skip to content

Commit 9e9f307

Browse files
committed
fix(ci): ensure validator output is captured and displayed properly
This commit addresses an issue where the validator's output was not properly captured and printed on the CI Signed-off-by: vprashar2929 <[email protected]>
1 parent e847847 commit 9e9f307

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

ansible/mock_acpi_playbook.yaml

+19-10
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,22 @@
4747
('success' not in prometheus_metrics.stdout) or
4848
('"result": []' in prometheus_metrics.stdout)
4949
50-
- name: Run mock-acpi validator
51-
shell: |
52-
cd {{ validator_dir }}
53-
hatch run validator -f ./validator.mock-acpi.yaml validate-acpi -d 1m
54-
when: prometheus_metrics is success
55-
register: mock_acpi_validator
56-
failed_when: |
57-
('error' in mock_acpi_validator.stdout.lower()) or
58-
('mse exceeded' in mock_acpi_validator.stdout.lower()) or
59-
('mape exceeded' in mock_acpi_validator.stderr.lower())
50+
- block:
51+
- name: Run mock-acpi validator
52+
shell: |
53+
cd {{ validator_dir }}
54+
hatch run validator -f ./validator.mock-acpi.yaml validate-acpi -d 1m
55+
when: prometheus_metrics is success
56+
register: mock_acpi_validator
57+
always:
58+
- name: Output the results of validator
59+
debug:
60+
var: mock_acpi_validator
61+
62+
- name: Check for errors in validator
63+
fail:
64+
msgg: "Mock-ACPI validator failed with the following errors: {{ mock_acpi_validator.stdout }} {{ mock_acpi_validator.stderr }}"
65+
when: >
66+
('error' in mock_acpi_validator.stdout.lower()) or
67+
('mse exceeded' in mock_acpi_validator.stdout.lower()) or
68+
('mape exceeded' in mock_acpi_validator.stderr.lower())

0 commit comments

Comments
 (0)