Skip to content

Commit

Permalink
Test Ruby 3.2 to support Amazon Linux 2023 (#2850)
Browse files Browse the repository at this point in the history
* Test Ruby 3.2 to support Amazon Linux 2023

* Replace File.exists? with File.exist?

* Fix Zeitwerk check?
  • Loading branch information
treydock authored May 30, 2023
1 parent ec12f6e commit 03156c9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
- os: ubuntu-latest
ruby: "3.0.2"
bundler: "2.3.5"
# Test versions from Amazon Linux 2023
- os: ubuntu-latest
ruby: "3.2.2"
bundler: "2.4.10"
runs-on: ${{ matrix.os }}
name: Unit tests

Expand Down Expand Up @@ -53,7 +57,10 @@ jobs:
run: bundle exec rake test:shellcheck

- name: Run Zeitwerk check
run: cd apps/dashboard; bundle exec rake zeitwerk:check
run: |
cd apps/dashboard
bundle install
bundle exec rake zeitwerk:check
- name: Run lint tests
run: bundle exec rake lint || true
Expand Down
2 changes: 1 addition & 1 deletion ood-portal-generator/lib/ood_portal_generator/dex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def copy_ssl_certs
else
next
end
if File.exists?(value) && self.class.installed? && enabled?
if File.exist?(value) && self.class.installed? && enabled?
FileUtils.cp(value, newpath, preserve: true, verbose: true)
FileUtils.chown(OodPortalGenerator.dex_user, OodPortalGenerator.dex_group, newpath, verbose: true)
end
Expand Down
8 changes: 4 additions & 4 deletions ood-portal-generator/spec/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ def test_generate(input, output)
dex: true
})
described_class.generate()
expect(File.exists?(File.join(config_dir, 'cert'))).to eq(true)
expect(File.exist?(File.join(config_dir, 'cert'))).to eq(true)
expect(File.read(File.join(config_dir, 'cert'))).to eq('CERT')
expect(File.exists?(File.join(config_dir, 'key'))).to eq(true)
expect(File.exist?(File.join(config_dir, 'key'))).to eq(true)
expect(File.read(File.join(config_dir, 'key'))).to eq('KEY')
end

Expand All @@ -380,8 +380,8 @@ def test_generate(input, output)
]
})
described_class.generate()
expect(File.exists?(File.join(config_dir, 'cert'))).to eq(false)
expect(File.exists?(File.join(config_dir, 'key'))).to eq(false)
expect(File.exist?(File.join(config_dir, 'cert'))).to eq(false)
expect(File.exist?(File.join(config_dir, 'key'))).to eq(false)
end

it 'generates LDAP dex configs with SSL' do
Expand Down

0 comments on commit 03156c9

Please sign in to comment.