Skip to content

Commit

Permalink
Pre-create config files to ensure consistent integration run output
Browse files Browse the repository at this point in the history
  • Loading branch information
marcparadise committed Apr 20, 2018
1 parent 52f0b0f commit 470c1fb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions components/chef-workstation/spec/integration/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
require "chef-workstation/cli"
require "chef-workstation/version"

# Create the chef configuration directory and touch the config
# file.
# this makes sure our output doesn't include
# an extra line telling us that it's created,
# causing the first integration test to execute to fail on
# CI.
# TODO this is not ideal... let's look at
# testing the output correctly in both cases,
# possible forcing a specific test that will also create
# the directory to run first.
dir = File.join(Dir.home, ".chef-workstation")
conf = File.join(dir, "config.toml")
FileUtils.mkdir_p(dir) unless Dir.exists?(dir)
FileUtils.touch(conf) unless File.exists?(conf)



# Simple wrapper that runs the CLI and prevents it
# from aborting all tests with a SystemExit.
# We could shell out, but this will run a little faster as we
Expand Down

0 comments on commit 470c1fb

Please sign in to comment.