Fix jq query testing if we got valid json 72/63372/2
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 11 Mar 2020 16:37:00 +0000 (09:37 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 11 Mar 2020 17:06:04 +0000 (10:06 -0700)
commit1c99557ff1b60356f85193d00e23020bb9e53467
tree120a1912620ddb5723607726d882049117d98e87
parentbf2c57751c5ddf5004b74bb2b575d4751435a6f5
Fix jq query testing if we got valid json

While looking over cost data from OpenDaylight I noticed that we started
getting data that had unknown resources with 0 cost associated with it.
After digging in I found out that the job-cost.sh had been updated to
verify that the data received back was valid json.

Testing this out locally everything worked just fine, so I tested the
work flow on an instance in the build environment and found that the
version of jq on the systems throws an error if you try to redirect the
output without having a query, which is exactly what was being done for
the test for if we received a valid json block.

A little further testing showed me that changing the call to include a
query of '.' would just parse everything (as I expected) and that it
doesn't fail the test.

For further information this appears to be a bug in jq v1.5 which is
installed on the Centos7 systems but jq v1.6 which I have locally works
just fine.

Change-Id: Id1ffc4ce71903f62d56e62e6569975710294c630
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
releasenotes/notes/fix_costing_jq_test-0d6954b3384ea99d.yaml [new file with mode: 0644]
shell/job-cost.sh