Artifact tests may fail due to warnings about `Insecure world writable dir /usr/local/bundle in PATH` appearing in stderr
Signed-off-by: James Stocks <jstocks@chef.io>
plan.sh was expanding $PATH at build time when writing out the inspec bin script. This is incorrect, the variable should be expanded at runtime.
Signed-off-by: James Stocks <jstocks@chef.io>
Add a @state ivar to the Profile class to represent state.
Add additional comments to the Metadata class to clarify that it represents metadata but not runtime state.
Signed-off-by: James Stocks <jstocks@chef.io>
Fixes#5131
Due to the use of `#split(‘=‘)` against inputs supplied via the CLI we had an edge case where inputs with `’=‘` in the value would cause a breakage.
This PR supplies a test for the regression and fixes the bug with a regex solution.
Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
macOS 11 Big Sur will be released later this year. Current beta versions
return 10.16 as the version, but the product name has changed from 'Mac
OS X' to 'macOS'. Train probably needs to be modified to deprecate
'mac_os_x' as a platform in favor of 'macos' but that would be a
significant downstream change. Train does fall back to 'darwin' on macOS
10.16, so by adding darwin to the list of platform names for the service
resource we are able to work around this for the moment.
This is the only location where mac_os_x is currently being used in
InSpec. Because we're in a case statement on platform rather than the
more generic platform family, we can't simply remove mac_os_x in favor
of darwin.
Signed-off-by: Bryan McLellan <btm@loftninjas.org>
We have 72 `skip_windows` that need addressing. This PR removes
confirmed instances where the tests now work on windows. It also marks
tests with a comment where they are confirmed to still break. Unmarked
instances still need review.
It also updates the `skip_windows` expiration date.
72 `skip_windows` needing resolution OR alternative documentation upon investigation
Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
Occasionally when the `isolated` tests run in CI, this error is seen:
```
inspec-reporter-html2::when run on a basic profile#test_0002_should produce valid HTML:
Errno::ENOENT: No such file or directory @ apply2files - /tmp/temp20200625-1802-2izu7e.html
/usr/local/lib/ruby/2.6.0/fileutils.rb:1437:in `unlink'
/usr/local/lib/ruby/2.6.0/fileutils.rb:1437:in `block in remove_file'
/usr/local/lib/ruby/2.6.0/fileutils.rb:1442:in `platform_support'
/usr/local/lib/ruby/2.6.0/fileutils.rb:1436:in `remove_file'
/usr/local/lib/ruby/2.6.0/fileutils.rb:775:in `remove_file'
/usr/local/lib/ruby/2.6.0/fileutils.rb:562:in `block in rm'
/usr/local/lib/ruby/2.6.0/fileutils.rb:561:in `each'
/usr/local/lib/ruby/2.6.0/fileutils.rb:561:in `rm'
lib/plugins/inspec-reporter-html2/test/functional/inspec_reporter_html2_test.rb:9:in `teardown'
```
It should be OK to ignore the failure to delete the test file - the issue doesn't reproduce on laptops, and CI uses clean VMs each time.
Signed-off-by: James Stocks <jstocks@chef.io>