-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hanami app to integration CI configurations (#3639)
What does this PR do? Adds hanami to CI configurations, as requested in #2546. Several things needed to be fixed for the tests to pass: Fix hanami integration app dependencies #2546 There was an empty hanami.rb which looks to have been intended to mock Hanami framework (?). The app requires the actual hanami framework to function and this empty file was loaded instead of hanami itself. I removed the file. Hanami integration app was missing unicorn configuration, which the test suite was expecting. I copied it from sinatra. The controller in the test app was written to fail 50% of the time, presumably to provide an environment to test failure. I commented out the failure generation so that CI would pass every time. I also made the image build script work when ruby version isn't given and to provide a help message so that someone new to this area of the code could actually get it running locally. Motivation: Review of #2546. Test plan The tests are running on Ruby 2.6 and 2.7 only. Hanami 1 (1.3.5, more exactly) that is currently being used in these tests is not compatible with Ruby 3. Co-authored-by: Oleg Pudeyev <code@olegp.name> Co-authored-by: Tony Hsu <tonyc.t.hsu@gmail.com>
- Loading branch information
1 parent
595b30d
commit b3c5a3d
Showing
9 changed files
with
56 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Integration tests that run in docker should not receive the gemfile lock | ||
# files that aren't checked into git, because these lock files are dependent | ||
# on the system set of installed software which is different between the | ||
# host and the docker container. | ||
# | ||
# Gemfile lock files that *are* checked into git should be in docker | ||
# containers also. | ||
Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'datadog/demo_env' | ||
|
||
# config/unicorn.rb | ||
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) | ||
timeout 15 | ||
preload_app true | ||
|
||
Datadog::DemoEnv.print_env('Unicorn master environment') | ||
|
||
before_fork do |server, worker| | ||
Signal.trap 'TERM' do | ||
puts 'Unicorn master intercepting TERM and sending myself QUIT instead' | ||
Process.kill 'QUIT', Process.pid | ||
end | ||
end | ||
|
||
after_fork do |server, worker| | ||
Signal.trap 'TERM' do | ||
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' | ||
end | ||
|
||
Datadog::DemoEnv.print_env('Unicorn worker environment') | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters