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

Fixed tests #1167

Merged
merged 5 commits into from
May 8, 2024
Merged

Fixed tests #1167

merged 5 commits into from
May 8, 2024

Conversation

aidanharan
Copy link
Contributor

@aidanharan aidanharan commented May 2, 2024

  1. Coerce HasManyThroughAssociationsTest#test_associate_existing test as MSSSQL has no release savepoint query.
HasManyThroughAssociationsTest#test_associate_existing [/usr/local/bundle/bundler/gems/rails-087260d0fce3/activerecord/test/cases/associations/has_many_through_associations_test.rb:224]:
2 instead of 3 queries were executed. Queries: SAVE TRANSACTION active_record_1

EXEC sp_executesql N'INSERT INTO [readers] ([post_id], [person_id]) OUTPUT INSERTED.[id] VALUES (@0, @1)', N'@0 int, @1 int', @0 = 2, @1 = 2.
Expected: 3
  Actual: 2

bin/rails test /usr/local/bundle/bundler/gems/rails-087260d0fce3/activerecord/test/cases/associations/has_many_through_associations_test.rb:220

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/actions/runs/8928362210/job/24523775374

  1. Fixed RelationMergingTest#test_merge_doesnt_duplicate_same_clauses_coerced.

Fix required because of rails/rails#51139

  1. Coerced QueryLogsTest#test_sqlcommenter_format_allows_string_keys and reimplemented.

  2. Fixed SanitizeTest#test_sanitize_sql_like_example_use_case_coerced.

  3. Fixed CalculationsTest#test_count_for_a_composite_primary_key_model_with_includes_and_references. Ported change from Fix count queries on includes+references for models with composite primary keys rails/rails#51655

@aidanharan aidanharan changed the title Coerce test as no query to release savepoint Fixed tests May 4, 2024
@aidanharan aidanharan marked this pull request as ready for review May 8, 2024 20:32
@aidanharan aidanharan merged commit 9849019 into main May 8, 2024
2 of 8 checks passed
@aidanharan aidanharan deleted the coerce-test-no-release-savepoint branch May 8, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant