Skip to content

Commit

Permalink
Add tests for whether mixin output is checked-in
Browse files Browse the repository at this point in the history
With the proposed workflow mixin output is generated offline and
checked into version control for direct usage.
A test is added to check whether the generated rules and dashboards
match the checked-in version.
Additionally checks for the shellscript generating the mixins and for
the mixin test playbook from above are added.

Signed-off-by: Jan Horstmann <horstmann@osism.tech>
  • Loading branch information
janhorstmann committed Nov 7, 2024
1 parent d9ac2d0 commit 91120a1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
38 changes: 38 additions & 0 deletions .src/playbooks/mixin-ouput-ensure-git-checkin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
- name: Run check-shell-syntax
connection: local
hosts: localhost
#hosts: all
vars:
zuul:
project:
src_dir: ../..
tasks:
- name: Build monitoring-mixin container
containers.podman.podman_image:
name: mixin-builder
path: "./{{ zuul.project.src_dir }}/.src"
build:
file: "./{{ zuul.project.src_dir }}/.src/Containerfile"
- name: Install monitoring-mixin dependencies
containers.podman.podman_container:
command: jb install
<<: &mixin_container_options
name: mixin-builder
image: localhost/mixin-builder
detach: false
volume:
- "./{{ zuul.project.src_dir }}:/srv"
rm: true
- name: Render monitoring-mixin rules / dashboards
containers.podman.podman_container:
<<: *mixin_container_options
- name: Check difference between git and generated rules / dashboards
ansible.builtin.command:
argv:
- /usr/bin/git
- diff
- --exit-code
register: git_diff
changed_when: false
failed_when: git_diff.rc != 0
7 changes: 1 addition & 6 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@
check:
jobs:
- yamllint
gate:
jobs:
- yamllint
periodic-daily:
jobs:
- yamllint
- name: ansible-lint

Check warning on line 8 in .zuul.yaml

View check run for this annotation

osism-zuul-app / osism/check

.zuul.yaml#L2-L8

'str' object does not support item assignment

0 comments on commit 91120a1

Please sign in to comment.