Skip to content

Conversation

@orien
Copy link
Member

@orien orien commented Jan 31, 2023

Context

Ruby 3.2 has been released! Let's get Stack Master working on this.

Change

  • Resolve Ruby deprecation: replace File.exists? with File.exist?. This is the only change to files included in the gem.
  • Add Ruby 3.2 to the RSpec CI matrix and get the test suite working with this version of Ruby.

orien added 5 commits January 31, 2023 16:04
This resolves the flaky behaviour in CI.
Different versions of Ruby provide different error messages.
This avoids failing specs in development environments where the default
region is not us-east-1.
Comment on lines -12 to -15
before do
allow(File).to receive(:read).and_return('file content')
end

Copy link
Member Author

Choose a reason for hiding this comment

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

Avoid stubbing File.read. This resolves the flaky behaviour in CI.

allow_any_instance_of(described_class).to receive(:`).with("op --version").and_return(true)
allow_any_instance_of(described_class).to receive(:`).with("op get item --vault='Shared' 'password title' 2>&1").and_return('{key: value }')
expect { resolver.resolve(the_password) }.to raise_error(StackMaster::ParameterResolvers::OnePassword::OnePasswordInvalidResponse, /Failed to parse JSON returned, {key: value }: \d+: unexpected token at '{key: value }'/)
expect { resolver.resolve(the_password) }.to raise_error(StackMaster::ParameterResolvers::OnePassword::OnePasswordInvalidResponse, /Failed to parse JSON returned, {key: value }:.* unexpected token at '{key: value }'/)
Copy link
Member Author

Choose a reason for hiding this comment

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

Be more lenient with the error message expectation here. Different versions of Ruby provide slightly different error messages.

let(:outputs) { [] }

before do
allow(StackMaster.cloud_formation_driver).to receive(:region).and_return(region)
Copy link
Member Author

Choose a reason for hiding this comment

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

Stub out the default AWS region. This prevents specs failing in development environments where the default
region is not us-east-1.

@orien orien requested review from stergiom and viraptor January 31, 2023 05:12
Copy link
Contributor

@petervandoros petervandoros left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link

@stergiom stergiom left a comment

Choose a reason for hiding this comment

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

🚀

@orien orien merged commit b1ffb8c into master Jan 31, 2023
@orien orien deleted the ruby-3.2 branch January 31, 2023 06:08
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.

4 participants