Skip to content

Commit

Permalink
Refactor unit test rake task
Browse files Browse the repository at this point in the history
Signed-off-by: Ross Moles <[email protected]>
  • Loading branch information
Ross Moles authored and Stuart Paterson committed Aug 14, 2020
1 parent 71fec5e commit 18b1b3b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
5 changes: 0 additions & 5 deletions .expeditor/buildkite/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

set -ueo pipefail

export AZURE_SUBSCRIPTION_ID=placeHolder
export AZURE_CLIENT_ID=placeHolder
export AZURE_TENANT_ID=placeHolder
export AZURE_CLIENT_SECRET=placeHolder

echo "--- system details"
uname -a
ruby -v
Expand Down
25 changes: 19 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,27 @@ namespace :azure do
end
end

# Minitest
Rake::TestTask.new(:unit) do |t|
t.libs << 'test/unit'
t.libs << 'libraries'
t.verbose = true
t.warning = false
t.test_files = FileList['test/unit/**/*_test.rb']
end

namespace :test do

Rake::TestTask.new(:unit) do |t|
t.libs << 'test/unit'
t.libs << 'libraries'
t.verbose = true
t.warning = false
t.test_files = FileList['test/unit/**/*_test.rb']
task :unit do
ENV['AZURE_SUBSCRIPTION_ID']='placeHolder' if !ENV['AZURE_SUBSCRIPTION_ID']
ENV['AZURE_CLIENT_ID']='placeHolder' if !ENV['AZURE_CLIENT_ID']
ENV['AZURE_TENANT_ID']='placeHolder' if !ENV['AZURE_TENANT_ID']
ENV['AZURE_CLIENT_SECRET']='placeHolder' if !ENV['AZURE_CLIENT_SECRET']
Rake::Task['unit'].execute
ENV['AZURE_SUBSCRIPTION_ID']=nil if ENV['AZURE_SUBSCRIPTION_ID']=='placeHolder'
ENV['AZURE_CLIENT_ID']=nil if ENV['AZURE_CLIENT_ID']=='placeHolder'
ENV['AZURE_TENANT_ID']=nil if ENV['AZURE_TENANT_ID']=='placeHolder'
ENV['AZURE_CLIENT_SECRET']=nil if ENV['AZURE_CLIENT_SECRET']=='placeHolder'
end

task :integration, [:controls] => ['attributes:write', :setup_env] do |_t, args|
Expand Down

0 comments on commit 18b1b3b

Please sign in to comment.