From f3fc535fee4c58646039564d7b7d1c281cb1884b Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Wed, 9 Oct 2019 17:40:31 -0700 Subject: [PATCH] Changed formatting and ordering of test data to reduce diffs on failing tests. Signed-off-by: Ryan Davis --- test/unit/mock/reporters/json_merged_output | 146 +++++++++++++++++++- 1 file changed, 145 insertions(+), 1 deletion(-) diff --git a/test/unit/mock/reporters/json_merged_output b/test/unit/mock/reporters/json_merged_output index 903852b8c..10f91b577 100644 --- a/test/unit/mock/reporters/json_merged_output +++ b/test/unit/mock/reporters/json_merged_output @@ -1 +1,145 @@ -{"platform":{"name":"mac_os_x","release":"17.5.0"},"profiles":[{"name":"wrapper-override","version":"0.6.1","sha256":"7436aac31d44de7987419d5f2ffb822f265645f4fc3c5d2ab37d8fff4dd5cf61","title":"Linux Wrapper Child Profile","maintainer":"Demo, Inc.","summary":"Profile that wraps other profiles","license":"Apache-2.0","copyright":"Demo, Inc.","copyright_email":"support@example.com","supports":[],"attributes":[],"depends":[{"name":"myprofile1z","url":"https://s3-eu-west-1.amazonaws.com/apop-bucket/profiles/myprofile1-1.0.0.tar.gz"}],"groups":[{"id":"/Users/jquick/.inspec/cache/e39eb85366b272bae98e5eecdfac9f84c50a9ae9dd625fba2ce847268a6c3477/controls/profile1.rb","controls":["pro1-con1","pro1-con2","pro1-con4"]}],"controls":[{"id":"pro1-con1","title":"Profile 1 - Control 1","desc":"Profile 1 - Control 1 description","descriptions":[{"label":"default","data":"Profile 1 - Control 1 description"}],"impact":0.8,"refs":[],"tags":{"hosts":null,"file":null,"cce":"CCE-27072-8"},"code":"control 'pro1-con1' do\n impact 0.8\n title 'Profile 1 - Control 1'\n desc 'Profile 1 - Control 1 description'\n tag 'hosts','file'\n tag cce: 'CCE-27072-8'\n describe file('/etc/hosts') do\n its('mode') { should eq 0644 }\n end\nend\n","source_location":{"line":1,"ref":"/Users/jquick/.inspec/cache/e39eb85366b272bae98e5eecdfac9f84c50a9ae9dd625fba2ce847268a6c3477/controls/profile1.rb"},"results":[{"status":"passed","code_desc":"File /etc/hosts mode should eq 420","run_time":0.031503,"start_time":"2018-07-30T08:56:41-04:00"}],"waiver_data":{}},{"id":"pro1-con2","title":"Profile 1 - Control 2-updated","desc":"Profile 1 - Control 2 description-updated","descriptions":[{"label":"default","data":"Profile 1 - Control 2 description-updated"}],"impact":0.999,"refs":[{"ref":[{"url":"https://example.com","ref":"Section 3.5.2.1"}]}],"tags":{"password":null,"password-updated":null},"code":" control 'pro1-con2' do\n impact 0.999\n title 'Profile 1 - Control 2-updated'\n desc 'Profile 1 - Control 2 description-updated'\n tag 'password-updated'\n ref 'Section 3.5.2.1', url: 'https://example.com'\n describe file('/etc/passwd') do\n it { should exist }\n end\n end\n","source_location":{"line":6,"ref":"wrapper-override/controls/defaut.rb"},"results":[{"status":"passed","code_desc":"File /etc/passwd should exist","run_time":0.003954,"start_time":"2018-07-30T08:56:41-04:00"}],"waiver_data":{}},{"id":"pro1-con4","title":"Profile 1 - Control 3 - useless","desc":"Profile 1 - Control 3 description","descriptions":[{"label":"default","data":"Profile 1 - Control 3 description"}],"impact":1,"refs":[],"tags":{},"code":"control 'pro1-con4' do\n impact 1\n title 'Profile 1 - Control 3 - useless'\n desc 'Profile 1 - Control 3 description'\n only_if do\n 1.eql?(0)\n end\n describe file('/tmp5') do\n it { should exist }\n end\nend\n","source_location":{"line":31,"ref":"/Users/jquick/.inspec/cache/e39eb85366b272bae98e5eecdfac9f84c50a9ae9dd625fba2ce847268a6c3477/controls/profile1.rb"},"results":[{"status":"skipped","code_desc":"Operating System Detection","run_time":2.9e-05,"start_time":"2018-07-30T08:56:41-04:00","resource":"Operating System Detection","skip_message":"Skipped control due to only_if condition."}],"waiver_data":{}}]}],"statistics":{"duration":0.039182},"version":"2.2.26"} +{ + "platform": { + "name": "mac_os_x", + "release": "17.5.0" + }, + "profiles": [ + { + "name": "wrapper-override", + "version": "0.6.1", + "sha256": "7436aac31d44de7987419d5f2ffb822f265645f4fc3c5d2ab37d8fff4dd5cf61", + "title": "Linux Wrapper Child Profile", + "maintainer": "Demo, Inc.", + "summary": "Profile that wraps other profiles", + "license": "Apache-2.0", + "copyright": "Demo, Inc.", + "copyright_email": "support@example.com", + "supports": [], + "attributes": [], + "depends": [ + { + "name": "myprofile1z", + "url": "https://s3-eu-west-1.amazonaws.com/apop-bucket/profiles/myprofile1-1.0.0.tar.gz" + } + ], + "groups": [ + { + "id": "/Users/jquick/.inspec/cache/e39eb85366b272bae98e5eecdfac9f84c50a9ae9dd625fba2ce847268a6c3477/controls/profile1.rb", + "controls": [ + "pro1-con1", + "pro1-con2", + "pro1-con4" + ] + } + ], + "controls": [ + { + "id": "pro1-con1", + "title": "Profile 1 - Control 1", + "desc": "Profile 1 - Control 1 description", + "descriptions": [ + { + "label": "default", + "data": "Profile 1 - Control 1 description" + } + ], + "impact": 0.8, + "refs": [], + "tags": { + "hosts": null, + "file": null, + "cce": "CCE-27072-8" + }, + "code": "control 'pro1-con1' do\n impact 0.8\n title 'Profile 1 - Control 1'\n desc 'Profile 1 - Control 1 description'\n tag 'hosts','file'\n tag cce: 'CCE-27072-8'\n describe file('/etc/hosts') do\n its('mode') { should eq 0644 }\n end\nend\n", + "source_location": { + "line": 1, + "ref": "/Users/jquick/.inspec/cache/e39eb85366b272bae98e5eecdfac9f84c50a9ae9dd625fba2ce847268a6c3477/controls/profile1.rb" + }, + "waiver_data": {}, + "results": [ + { + "status": "passed", + "code_desc": "File /etc/hosts mode should eq 420", + "run_time": 0.031503, + "start_time": "2018-07-30T08:56:41-04:00" + } + ] + }, + { + "id": "pro1-con2", + "title": "Profile 1 - Control 2-updated", + "desc": "Profile 1 - Control 2 description-updated", + "descriptions": [ + { + "label": "default", + "data": "Profile 1 - Control 2 description-updated" + } + ], + "impact": 0.999, + "refs": [ + { + "ref": [ + { + "url": "https://example.com", + "ref": "Section 3.5.2.1" + } + ] + } + ], + "tags": { + "password": null, + "password-updated": null + }, + "code": " control 'pro1-con2' do\n impact 0.999\n title 'Profile 1 - Control 2-updated'\n desc 'Profile 1 - Control 2 description-updated'\n tag 'password-updated'\n ref 'Section 3.5.2.1', url: 'https://example.com'\n describe file('/etc/passwd') do\n it { should exist }\n end\n end\n", + "source_location": { + "line": 6, + "ref": "wrapper-override/controls/defaut.rb" + }, + "waiver_data": {}, + "results": [ + { + "status": "passed", + "code_desc": "File /etc/passwd should exist", + "run_time": 0.003954, + "start_time": "2018-07-30T08:56:41-04:00" + } + ] + }, + { + "id": "pro1-con4", + "title": "Profile 1 - Control 3 - useless", + "desc": "Profile 1 - Control 3 description", + "descriptions": [ + { + "label": "default", + "data": "Profile 1 - Control 3 description" + } + ], + "impact": 1, + "refs": [], + "tags": {}, + "code": "control 'pro1-con4' do\n impact 1\n title 'Profile 1 - Control 3 - useless'\n desc 'Profile 1 - Control 3 description'\n only_if do\n 1.eql?(0)\n end\n describe file('/tmp5') do\n it { should exist }\n end\nend\n", + "source_location": { + "line": 31, + "ref": "/Users/jquick/.inspec/cache/e39eb85366b272bae98e5eecdfac9f84c50a9ae9dd625fba2ce847268a6c3477/controls/profile1.rb" + }, + "waiver_data": {}, + "results": [ + { + "status": "skipped", + "code_desc": "Operating System Detection", + "run_time": 2.9e-05, + "start_time": "2018-07-30T08:56:41-04:00", + "resource": "Operating System Detection", + "skip_message": "Skipped control due to only_if condition." + } + ] + } + ] + } + ], + "statistics": { + "duration": 0.039182 + }, + "version": "2.2.26" +}