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 Rails 7.1 to the test matrix #64

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ concurrency:

jobs:
tests:
continue-on-error: true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Disable the continue-on-error setting. This caused the workflow to always pass, even if a job failed.

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error

strategy:
fail-fast: false
Copy link
Contributor Author

@orien orien Mar 19, 2024

Choose a reason for hiding this comment

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

Disable fail-fast. This prevents GitHub Actions from canceling remaining jobs if any job in the matrix fails.

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast

matrix:
ruby: [ "3.3", "3.2", "3.1", "3.0" ]
rails: [ "7.0", "6.1"]
rails: [ "7.1", "7.0", "6.1"]
include:
- { ruby: "2.7", rails: "6.0" }
- { ruby: "2.7", rails: "5.2" }
Expand Down
3 changes: 3 additions & 0 deletions test/gemfiles/rails-7.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"
gemspec path: "../.."
gem "activerecord", "~> 7.1.0"
3 changes: 2 additions & 1 deletion test/integration/mysql_integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class AfterPersistedTest < MySQLIntegrationTest
end

test "can't be used to inject SQL using .where" do
assert_raises MySQLBinUUID::InvalidUUID do
expected_error = ActiveRecord.version.to_s < "7.1" ? MySQLBinUUID::InvalidUUID : ActiveRecord::StatementInvalid
assert_raises(expected_error) do
MyUuidModel.where(the_uuid: "' OR ''='").first
end
end
Comment on lines 108 to 113
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Rails 7.1, the MySQLBinUUID::InvalidUUID error raised by this library gets wrapped in an ActiveRecord::StatementInvalid.

Expand Down