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

Add tests and CI #375

Merged
merged 3 commits into from
Aug 7, 2024
Merged

Add tests and CI #375

merged 3 commits into from
Aug 7, 2024

Conversation

willnet
Copy link
Contributor

@willnet willnet commented Jul 9, 2024

Deploying with Capistrano and systemd can be difficult to verify manually, so I automated the verification using tests and CI. I used a Debian Docker image to create a container running systemd, and deployed a small Sinatra application to confirm it works.

With mostly default settings, I confirmed that the four tasks puma:install, deploy, puma:stop, and puma:start work as expected. It would be good to also verify other tasks and the nginx configuration, but for now, this provides the minimum necessary verification.

Running the tests revealed two issues, which I was able to fix. For details, please refer to the descriptions of each commit.

All tests from Ruby 2.5 to 3.3 have passed, as shown in the following link:

Fix ci on Ruby 2.5 · willnet/capistrano-puma@9a83087

Ideally, this PR should be merged and version 6.0.0 released. However, if there is no response, I will consider releasing a forked gem.

Deploying with Capistrano and systemd can be difficult to verify manually, so I automated the verification using tests and CI. I used a Debian Docker image to create a container running systemd, and deployed a small Sinatra application to confirm it works.

With mostly default settings, I confirmed that the four tasks puma:install, deploy, puma:stop, and puma:start work as expected. It would be good to also verify other tasks and the nginx configuration, but for now, this provides the minimum necessary verification.
```
#<Thread:0x000000012a5d7570 /Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
/Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as willnet@localhost: Exception while executing as willnet@localhost: loginctl exit status: 1 (SSHKit::Runner::ExecuteError)
loginctl stdout: Nothing written
loginctl stderr: Could not enable linger: Access denied

	from /Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as willnet@localhost: loginctl exit status: 1 (SSHKit::Runner::ExecuteError)
loginctl stdout: Nothing written
loginctl stderr: Could not enable linger: Access denied

	from /Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/command.rb:97:in `exit_status=': loginctl exit status: 1 (SSHKit::Command::Failed)
loginctl stdout: Nothing written
loginctl stderr: Could not enable linger: Access denied
```
Fix an issue where the argument passing method for ERB.new in Ruby 2.5 differs from Ruby 2.6 and above, causing errors during template generation.

```
SSHKit::Runner::ExecuteError: Exception while executing as willnet@localhost: no implicit conversion of Hash into Integer
```

ref: https://ruby-doc.org/stdlib-2.5.0/libdoc/erb/rdoc/ERB.html#method-c-new
@climatebrad
Copy link
Contributor

@willnet would you be willing to fork? I think @seuros has abandoned this gem.

@seuros
Copy link
Owner

seuros commented Aug 6, 2024

I didn't.

I will release all this week.

Thanks for the ping @climatebrad

@willnet
Copy link
Contributor Author

willnet commented Aug 7, 2024

@seuros Looking forward to the release!

@willnet
Copy link
Contributor Author

willnet commented Aug 7, 2024

The tests corresponding to this PR failed because the branch used to retrieve the test application was set to master. Once this PR is merged, the tests should pass.

You can see that the error occurs while running git archive master test/app from the link below.

Add tests and CI · seuros/capistrano-puma@b53f608

@seuros
Copy link
Owner

seuros commented Aug 7, 2024

@seuros Looking forward to the release!

I installed github mobile recently and started to get notifications now.

Previously emails digest will show only if I was referenced.

@seuros seuros merged commit ae98407 into seuros:master Aug 7, 2024
0 of 7 checks passed
@willnet willnet deleted the add-test-for-pr branch August 7, 2024 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants