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

3.10 test fixes #10314

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Base container that is used for both building and running the app
FROM quay.io/centos/centos:stream8 as base
ARG RUBY_VERSION="2.7"
FROM quay.io/centos/centos:stream9 as base
ARG NODEJS_VERSION="18"
ENV FOREMAN_FQDN=foreman.example.com
ENV FOREMAN_DOMAIN=example.com

RUN \
dnf upgrade -y && \
dnf module enable ruby:${RUBY_VERSION} nodejs:${NODEJS_VERSION} -y && \
dnf module enable nodejs:${NODEJS_VERSION} -y && \
dnf install -y postgresql-libs ruby{,gems} rubygem-{rake,bundler} npm nc hostname && \
dnf clean all

Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ gem 'graphql-batch'
# A bundled gem since Ruby 3.0
gem 'rss' if RUBY_VERSION >= '3.0'

# FFI 1.17 needs rubygems 3.3.22+, which is Ruby 3.0+ only
gem "ffi", "<1.17" if RUBY_VERSION < '3.0'

Dir["#{File.dirname(FOREMAN_GEMFILE)}/bundler.d/*.rb"].each do |bundle|
instance_eval(Bundler.read_file(bundle))
end
5 changes: 3 additions & 2 deletions app/models/concerns/host_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ def image_file
end

def crypt_passwords
self.root_pass = crypt_pass(self[:root_pass], :root)
self.grub_pass = crypt_pass(self[:grub_pass] || self[:root_pass], :grub)
root_pass = self[:root_pass]
self.root_pass = crypt_pass(root_pass, :root)
self.grub_pass = crypt_pass(self[:grub_pass] || root_pass, :grub)
end

def crypt_pass(unencrypted_pass, pass_kind)
Expand Down
14 changes: 2 additions & 12 deletions test/unit/foreman/renderer/scope/report_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,8 @@ class ReportScopeTest < ActiveSupport::TestCase
expected_csv = "List,String,Number,Bool,Empty,Nil\n\"Val1,1,true\",Text,1,false,\"\",\"\"\n"
assert_equal expected_csv, @scope.report_render(format: :csv)

expected_yaml = <<~OUT + " Nil: \n"
---
- List:
- Val1
- 1
- true
String: Text
Number: 1
Bool: false
Empty: ''
OUT
assert_equal expected_yaml, @scope.report_render(format: :yaml)
expected_yaml = [{"List" => ["Val1", 1, true], "String" => "Text", "Number" => 1, "Bool" => false, "Empty" => "", "Nil" => nil}]
assert_equal expected_yaml, YAML.safe_load(@scope.report_render(format: :yaml))
end
end
end
Loading