Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail the build if a specified role is missing specs #40

Merged
merged 3 commits into from
Feb 20, 2019

Conversation

mipearson
Copy link
Contributor

Not sure on implementation here - I feel like there should be a more rspeccy way of doing this, preferably with a nice red rspec failure.

Anyway, this not failing fast caused lots of confusion as our passing build was not actually running tests against some of the roles it had been told to.

Copy link
Contributor

@viraptor viraptor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me

@@ -40,6 +47,7 @@ def run

RSpec.configuration.fail_fast = true if @debug


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooops. I've spent too long in javascript land, where prettier cleans up my mess for me ;)

Copy link
Contributor

@patrobinson patrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is before RSpec gets loaded anyway, so 👍 to printing an error and returning

puts "skip the role '#{@role}', create the directory but leave it empty"
puts "(except for a .gitkeep file)."
return false
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be done during initialization? Doing it during a run will spin up other AMIs to test still, despite an imminent failure. Otherwise a verify method might be useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I've just moved that in the latest commit.

unless Dir.exist?("#{options[:specs]}/#{role}")
fail "Role directory #{options[:specs]}/#{role} does not exist. If you'd like to skip the role '#{role}', create the directory but leave it empty (except for a .gitignore file)."
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only tests if we are using the file. We should also test when options[:ami] and options[:role] are supplied

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further up in the file options[:role] && options[:ami] are co-erced into options[:amis]

@mipearson mipearson merged commit 9566721 into master Feb 20, 2019
@orien orien deleted the mp-fail-missing-role branch July 16, 2019 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants