openqa/server: use jq for JSON comparison as json_diff died

Swiped from https://stackoverflow.com/questions/31930041/

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2020-04-30 12:33:50 -07:00
parent e6fe5f2598
commit 255ce6ebad

View file

@ -145,7 +145,7 @@
- name: Install various other required packages
package:
name: ['python3-libselinux', 'git', 'json_diff', 'libselinux-utils', 'python3-libsemanage',
name: ['python3-libselinux', 'git', 'jq', 'libselinux-utils', 'python3-libsemanage',
'nfs-utils', 'perl(Class::DBI::Pg)', 'expect', 'libguestfs-tools-c', 'libguestfs-xfs',
'libvirt-daemon-config-network', 'libvirt-python3', 'python3-libguestfs',
'virt-install', 'withlock', 'genisoimage']
@ -360,7 +360,7 @@
changed_when: "1 != 1"
- name: Check if the tests changed in previous step
shell: "/usr/share/openqa/script/dump_templates --json > /tmp/tmpl-new.json && json_diff /tmp/tmpl-old.json /tmp/tmpl-new.json"
shell: "/usr/share/openqa/script/dump_templates --json > /tmp/tmpl-new.json && diff <(jq -S . /tmp/tmpl-old.json) <(jq -S . /tmp/tmpl-new.json)"
when: "(gittests is defined) and (gittests is changed)"
register: testsdiff
changed_when: "testsdiff.rc > 0"