Skip to content

fix(ci): ensure validator output is captured and displayed properly #1707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions ansible/mock_acpi_playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,22 @@
('success' not in prometheus_metrics.stdout) or
('"result": []' in prometheus_metrics.stdout)

- name: Run mock-acpi validator
shell: |
cd {{ validator_dir }}
hatch run validator -f ./validator.mock-acpi.yaml validate-acpi -d 1m
when: prometheus_metrics is success
register: mock_acpi_validator
failed_when: |
('error' in mock_acpi_validator.stdout.lower()) or
('mse exceeded' in mock_acpi_validator.stdout.lower()) or
('mape exceeded' in mock_acpi_validator.stderr.lower())
- block:
- name: Run mock-acpi validator
shell: |
cd {{ validator_dir }}
hatch run validator -f ./validator.mock-acpi.yaml validate-acpi -d 1m
when: prometheus_metrics is success
register: mock_acpi_validator
always:
- name: Output the results of validator
debug:
var: mock_acpi_validator

- name: Check for errors in validator
fail:
msgg: "Mock-ACPI validator failed with the following errors: {{ mock_acpi_validator.stdout }} {{ mock_acpi_validator.stderr }}"
when: >
('error' in mock_acpi_validator.stdout.lower()) or
('mse exceeded' in mock_acpi_validator.stdout.lower()) or
('mape exceeded' in mock_acpi_validator.stderr.lower())
Loading