Skip to content

Commit

Permalink
Add CI for ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
karanthukral committed Jan 14, 2021
1 parent 031dd7f commit ec09ca3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .shopify-build/krane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ steps:
run:
- bundle: ~
- bundle exec rubocop
- label: 'Run Test Suite (:kubernetes: 1.20-latest :ruby: 2.7)'
- label: 'Run Test Suite (:kubernetes: 1.20-latest :ruby: 3.0)'
command: bin/ci
agents:
queue: k8s-ci
env:
LOGGING_LEVEL: "4"
KUBERNETES_VERSION: v1.20-latest
RUBY_VERSION: "2.7"
- label: 'Run Test Suite (:kubernetes: 1.19-latest)'
RUBY_VERSION: "3.0"
- label: 'Run Test Suite (:kubernetes: 1.19-latest :ruby: 2.7)'
command: bin/ci
agents:
queue: k8s-ci
env:
LOGGING_LEVEL: "4"
KUBERNETES_VERSION: v1.19-latest
RUBY_VERSION: "2.7"
- label: 'Run Test Suite (:kubernetes: 1.18-latest)'
command: bin/ci
agents:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## next

*Other*
- Dropped support for Ruby 2.5 since it will be EoL shortly. [#782](https://github.com/Shopify/krane/pull/782).
- Dropped support for Ruby 2.5 due to EoL. [#782](https://github.com/Shopify/krane/pull/782).

## 2.1.3

Expand Down
3 changes: 2 additions & 1 deletion test/helpers/fixture_sets/ejson_cloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def assert_all_secrets_present
token_data = { "api-token" => "this-is-the-api-token", "service" => "Datadog" } # Impt: it isn't _service: Datadog
assert_secret_present("monitoring-token", token_data)

assert_secret_present("unused-secret", "this-is-for-testing-deletion" => "true")
token_data = { "this-is-for-testing-deletion" => "true" }
assert_secret_present("unused-secret", token_data)
end

def assert_web_resources_up
Expand Down
15 changes: 10 additions & 5 deletions test/unit/krane/kubernetes_resource_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,16 @@ def test_validate_definition_doesnt_log_raw_output_for_sensitive_resources
resource = DummySensitiveResource.new
kubectl.expects(:server_version).returns(Gem::Version.new('1.20'))

kubectl.expects(:run).with { |*_args, **kwargs| kwargs[:output_is_sensitive] == true }.returns([
"Some Raw Output",
"Error from kubectl: something went wrong and by the way here's your secret: S3CR3T",
stub(success?: false),
])
kubectl.expects(:run)
.with('apply', '-f', "/tmp/foo/bar", "--dry-run=server", '--output=name', {
log_failure: false, output_is_sensitive: true,
retry_whitelist: [:client_timeout, :empty, :context_deadline], attempts: 3
})
.returns([
"Some Raw Output",
"Error from kubectl: something went wrong and by the way here's your secret: S3CR3T",
stub(success?: false),
])
resource.validate_definition(kubectl)
refute_includes(resource.validation_error_msg, 'S3CR3T')
end
Expand Down

0 comments on commit ec09ca3

Please sign in to comment.