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

Fix various tests #24

Closed
wants to merge 1 commit into from
Closed
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: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.4, 2.5, 2.6]
ruby: [2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -34,8 +34,11 @@ jobs:
- centos-stream-8
- ubuntu-1804
- ubuntu-2004
- ubuntu-2204
- debian-9
- debian-10
- debian-11
- debian-12
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/fb_apache/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
'sites' => {},
'status_config' => {
'Location /server-status' => {
'SetHandler' => 'server-status'
'SetHandler' => 'server-status',
},
},
'extra_configs' => {},
Expand Down
6 changes: 3 additions & 3 deletions cookbooks/fb_apache/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
end

baseconfig = value_for_platform_family(
'rhel' => "#{httpdir}/conf/httpd.conf",
'debian' => "#{httpdir}/apache2.conf",
'rhel' => "#{httpdir}/conf/httpd.conf",
'debian' => "#{httpdir}/apache2.conf",
)

sitesdir = value_for_platform_family(
Expand Down Expand Up @@ -168,7 +168,7 @@
mod_dir moddir
end

template "#{baseconfig}" do
template baseconfig do
owner 'root'
group 'root'
mode '0644'
Expand Down
15 changes: 7 additions & 8 deletions cookbooks/fb_apache/resources/verify_configs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
# This is
file = Chef::Util::FileEdit.new("#{tdir}/conf/httpd.conf")
file.search_file_replace_line(%r{^ServerRoot "/etc/httpd"$},
"ServerRoot \"#{tdir}\"") ||
fail('Apache validation failed. Cannot find `ServerRoot /etc/httpd`')
file.write_file
else node.debian_family?
"ServerRoot \"#{tdir}\"") ||
fail('Apache validation failed. Cannot find `ServerRoot /etc/httpd`')
file.write_file
elsif node.debian_family?
# Generate the base apache config before doing the path substitution trickery below.
build_resource(:template,
"#{tdir}/apache2.conf") do
Expand All @@ -58,12 +58,11 @@
end.run_action(:create)
file = Chef::Util::FileEdit.new("#{tdir}/apache2.conf")
file.search_file_replace_line(%r{^.?ServerRoot "/etc/apache2"$},
"ServerRoot \"#{tdir}\"") ||
fail('Apache validation failed. Cannot find `ServerRoot /etc/apache2`')
file.write_file
"ServerRoot \"#{tdir}\"") ||
fail('Apache validation failed. Cannot find `ServerRoot /etc/apache2`')
file.write_file
end


# we manually build the resource so that Chef does not add these to its
# resource collection and hence not track it for "updates".
build_resource(:template,
Expand Down
3 changes: 2 additions & 1 deletion cookbooks/fb_apt/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
strace_path = node['fb_apt']['apt_update_strace_path']
strace_flags = node['fb_apt']['apt_update_strace_flags']
cmd_suffix = " >>#{log_path.shellescape} 2>&1" if log_path
cmd_prefix = "strace #{strace_flags} -o #{strace_path.shellescape} " if strace_path && ::File.exist?('/usr/bin/strace')
cmd_prefix = "strace #{strace_flags} -o #{strace_path.shellescape} " \
if strace_path && ::File.exist?('/usr/bin/strace')
"#{cmd_prefix}apt-get update#{cmd_suffix}"
end)
action :nothing
Expand Down
2 changes: 1 addition & 1 deletion spec/fbspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def self.fbspec_init(cookbook_path, platforms)
config.after(:example) do
result = RubyProf.stop
printer = RubyProf::GraphPrinter.new(result)
printer.print(STDOUT)
printer.print($stdout)
end
end
end
Expand Down
Loading