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

Use RSpec and GitHub Actions #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

willnet
Copy link

@willnet willnet commented Nov 8, 2024

Fix #138

As of 2024, using Travis CI to build OSS requires contacting them to request a monthly allocation of credits, making the process more cumbersome. To simplify this, I migrated from Travis CI to GitHub Actions.

I converted the test coverage previously created with shell scripts to RSpec's Request Spec. Health checks for services like s3 and sidekiq were not included in the original tests, so they are not part of this commit. Additionally, redundant development gems and configuration for the test application that seemed unnecessary were removed to avoid noise.

I created a test matrix covering Ruby versions 2.4 to 3.3 and Rails versions 5.1 to 7.2, ensuring all tests pass.

You can also run the tests locally as follows:

export BUNDLE_GEMFILE=test/rails_7.1.gemfile
bundle install
bundle exec rake

Test result: Use RSpec and GitHub Actions · willnet/health_check@d00b366

Comment on lines -148 to +156
smtp.enable_starttls if settings[:enable_starttls_auto]
openssl_verify_mode = settings[:openssl_verify_mode]

if openssl_verify_mode.kind_of?(String)
openssl_verify_mode = OpenSSL::SSL.const_get("VERIFY_#{openssl_verify_mode.upcase}")
end

ssl_context = Net::SMTP.default_ssl_context
ssl_context.verify_mode = openssl_verify_mode if openssl_verify_mode
smtp.enable_starttls(ssl_context) if settings[:enable_starttls_auto]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the test environment has been configured to allow specifying OpenSSL::SSL::VERIFY_NONE to avoid errors caused by SSL certificates generated by fake_smtp_server.rb.

Fix Purple-Devs#138

As of 2024, [using Travis CI to build OSS requires contacting them to request a monthly allocation of credits](https://docs.travis-ci.com/user/billing-faq/#what-if-i-am-building-open-source), making the process more cumbersome. To simplify this, I migrated from Travis CI to GitHub Actions.

I converted the [test coverage previously created with shell scripts](https://github.com/Purple-Devs/health_check/blob/53ae042bf0cc69b1d8d7b1b47e2296303b0a591c/test/test_with_railsapp) to RSpec's Request Spec. Health checks for services like s3 and sidekiq were not included in the original tests, so they are not part of this commit. Additionally, redundant development gems and configuration for the test application that seemed unnecessary were removed to avoid noise.

I created a test matrix covering Ruby versions 2.4 to 3.3 and Rails versions 5.1 to 7.2, ensuring all tests pass.

You can also run the tests locally as follows:

```ruby
export BUNDLE_GEMFILE=test/rails_7.1.gemfile
bundle install
bundle exec rake
```
@willnet
Copy link
Author

willnet commented Nov 14, 2024

Hi @jmarchello,

I understand you might be quite busy, but whenever you have some time, could you please review this PR? Your input would be really valuable.

Thanks so much!

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.

Convert test suite to rspec
1 participant