Skip to content

Commit ba42356

Browse files
committed
Remove OSX spec options as they do not work
- remove conditionality for macOS (nee OSX) - add `skip` for tests which are not runnable on macOS - update README
1 parent 2a02c85 commit ba42356

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,6 @@ cd /opt/bosh/bosh-stemcell
177177
OS_IMAGE=/opt/bosh/tmp/ubuntu_base_image.tgz bundle exec rake spec:shellout_types
178178
```
179179

180-
If on macOS, run:
181-
182-
```shell
183-
OSX=true OS_IMAGE=/opt/bosh/tmp/ubuntu_base_image.tgz bundle exec rake spec:shellout_types
184-
```
185-
186180
### How to run tests for BOSH Linux Stemcell Builder
187181

188182
The BOSH Linux Stemcell Builder code itself can be tested with the following command's:

bosh-stemcell/spec/bosh/stemcell/helpers_sh_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
require 'spec_helper'
22

33
context 'helpers.sh' do
4+
before do
5+
skip "This spec requires linux" unless RUBY_PLATFORM.downcase.include?("linux")
6+
end
47

58
context 'add_on_exit runs cleanup commands in LIFO order' do
69
describe ShelloutTypes::Command.new(

bosh-stemcell/spec/shellout_types/spec_helper.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
require 'shellout_types/chroot'
44
require 'tmpdir'
55

6+
def supported_testing_os?
7+
RUBY_PLATFORM.downcase.include?("linux")
8+
end
69

710
RSpec.configure do |config|
811
if config.inclusion_filter[:shellout_types]
@@ -12,14 +15,12 @@
1215
config.add_setting(:os_image_dir, default: @os_image_dir)
1316

1417
config.before(:suite) do
18+
raise "Running 'shellout_types' specs on '#{RUBY_PLATFORM}' is not supported" unless supported_testing_os?
19+
1520
Bosh::Core::Shell.new.run("sudo tar zxf #{ENV['OS_IMAGE']} -C #{config.os_image_dir}")
1621
Bosh::Core::Shell.new.run("sudo chgrp -Rh $(id -g) #{config.os_image_dir}")
1722
Bosh::Core::Shell.new.run("sudo chmod 775 #{config.os_image_dir}")
18-
if ENV['OSX']
19-
Bosh::Core::Shell.new.run("sudo chroot #{config.os_image_dir} /bin/bash -c \"useradd --uid $(id -u) -G nogroup shellout\"")
20-
else
21-
Bosh::Core::Shell.new.run("sudo chroot #{config.os_image_dir} /bin/bash -c 'useradd -G nogroup shellout'")
22-
end
23+
Bosh::Core::Shell.new.run("sudo chroot #{config.os_image_dir} /bin/bash -c 'useradd -G nogroup shellout'")
2324
end
2425

2526
config.after(:suite) do

0 commit comments

Comments
 (0)