Skip to content

Commit

Permalink
Merge pull request #396 from 3scale/ruby33
Browse files Browse the repository at this point in the history
THREESCALE-11161 upgrade to ruby 3.3
  • Loading branch information
akostadinov authored Jul 24, 2024
2 parents bed3c1a + 084f903 commit d97c531
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ attach-to-workspace: &attach-to-workspace
at: /home/circleci

ruby-cache-key: &ruby-cache-key
asdf-ruby-3.0.2-v1
asdf-ruby-3.3.1-v1

bundle-cache-key: &bundle-cache-key
bundle-{{ .Environment.CACHE_VERSION }}-{{ checksum "Gemfile.lock" }}
Expand Down Expand Up @@ -60,7 +60,7 @@ commands:
keys:
- *ruby-cache-key
- run:
name: Install Ruby 3.0.2
name: Install Ruby 3.3
command: |
cd $HOME
if [ ! -d ".asdf" ]; then
Expand All @@ -69,8 +69,8 @@ commands:
echo '. "$HOME/.asdf/asdf.sh"' > ~/.bashrc
source .bashrc
asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
asdf install ruby 3.0.2
echo 'ruby 3.0.2' > $HOME/project/.tool-versions
asdf install ruby 3.3.1
echo 'ruby 3.3.1' > $HOME/project/.tool-versions
- save_cache:
paths:
- ../.asdf
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions.sample
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.0.2
ruby 3.3.1
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ gem 'falcon', '~> 0.35'
gem 'webrick', '~> 1.8'


gem 'dotenv', '~> 2.8.1'
gem 'dotenv'
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ GEM
daemons (1.2.4)
diff-lcs (1.5.1)
docile (1.1.5)
dotenv (2.8.1)
dotenv (3.1.2)
drb (2.2.1)
dry-initializer (3.0.3)
falcon (0.42.3)
Expand Down Expand Up @@ -133,7 +133,7 @@ GEM
nokogiri (1.16.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
openssl (3.1.0)
openssl (3.2.0)
pkg-config (1.1.9)
power_assert (2.0.3)
process-metrics (0.2.1)
Expand Down Expand Up @@ -269,7 +269,7 @@ DEPENDENCIES
builder (= 3.2.3)
codeclimate-test-reporter (~> 0.6.0)
daemons (= 1.2.4)
dotenv (~> 2.8.1)
dotenv
falcon (~> 0.35)
gli (~> 2.16.1)
hiredis-client
Expand Down
2 changes: 1 addition & 1 deletion lib/3scale/dotenv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# If doesn't exist, try to load .env.test
def env_file
file = ".env.#{ENV['RACK_ENV']}"
File.exists?(file) ? file : '.env.test'
File.exist?(file) ? file : '.env.test'
end

begin
Expand Down
15 changes: 10 additions & 5 deletions test/unit/storage_async_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def test_tls_no_client_certificate
config_obj = {
url: 'rediss://localhost:46379',
ssl_params: {
ca_file: File.expand_path(File.join(__FILE__, '..', '..', '..', 'script', 'config', 'ca-root-cert.pem'))
ca_file: create_ca(:rsa).path
}
}
storage = StorageAsync::Client.send :new, Storage::Helpers.config_with(config_obj)
Expand Down Expand Up @@ -308,11 +308,16 @@ def test_acl_tls

private

def create_ca(alg)
Tempfile.new('ca-root-cert.pem').tap do |ca_cert_file|
ca_cert_file.write(create_cert(create_key(alg)).to_pem)
ca_cert_file.flush
ca_cert_file.close
end
end

def create_certs(alg)
ca_cert_file = Tempfile.new('ca-root-cert.pem')
ca_cert_file.write(create_cert.to_pem)
ca_cert_file.flush
ca_cert_file.close
ca_cert_file = create_ca(alg)

key = create_key alg
key_file = Tempfile.new("redis-#{alg}.pem")
Expand Down

0 comments on commit d97c531

Please sign in to comment.