Skip to content

Commit 274f78d

Browse files
craig[bot]fqazi
andcommitted
Merge #158776
158776: roachtest/activerecord: bump rails version to 8.1 r=fqazi a=fqazi Previously, we were testing an older Rails versions against CRDB. Now that the new 8.1 version is avaialble, we can bump the version up, which will remove some flakes. As a part of this change we will also enable autocommit_before_ddl within the test suite. Fixes: #157123 Release note: None Co-authored-by: Faizan Qazi <[email protected]>
2 parents 818ff51 + be574aa commit 274f78d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

pkg/cmd/roachtest/tests/activerecord.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ var railsReleaseTagRegex = regexp.MustCompile(`^v(?P<major>\d+)\.(?P<minor>\d+)\
2828

2929
// WARNING: DO NOT MODIFY the name of the below constant/variable without approval from the docs team.
3030
// This is used by docs automation to produce a list of supported versions for ORM's.
31-
var supportedRailsVersion = "8.0.1"
32-
var activerecordAdapterVersion = "v8.0.1"
31+
var supportedRailsVersion = "8.1.0"
32+
var activerecordAdapterVersion = "v8.1.0"
3333

3434
// This test runs activerecord's full test suite against a single cockroach node.
3535

@@ -173,7 +173,18 @@ func registerActiveRecord(r registry.Registry) {
173173

174174
t.Status("running activerecord test suite")
175175

176+
// Enable autocommit before DDL by default within the test suite.
176177
result, err := c.RunWithDetailsSingleNode(ctx, t.L(), option.WithNodes(node),
178+
`cd /mnt/data1/activerecord-cockroachdb-adapter/ && `+
179+
`sudo sed -i 's/autocommit_before_ddl: false/autocommit_before_ddl: true/g' test/config.yml`,
180+
)
181+
// Fatal for a roachprod or transient error. A roachprod error is when result.Err==nil.
182+
// Proceed for any other (command) errors
183+
if err != nil && (result.Err == nil || rperrors.IsTransient(err)) {
184+
t.Fatal(err)
185+
}
186+
187+
result, err = c.RunWithDetailsSingleNode(ctx, t.L(), option.WithNodes(node),
177188
fmt.Sprintf(
178189
`cd /mnt/data1/activerecord-cockroachdb-adapter/ && `+
179190
`sudo RAILS_VERSION=%s RUBYOPT="-W0" TESTOPTS="-v" bundle exec rake test`, supportedRailsVersion),

pkg/cmd/roachtest/tests/activerecord_blocklist.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var activeRecordIgnoreList = blocklist{
3636
`AssociationCallbacksTest#test_has_many_callbacks_for_destroy_on_parent`: "flaky",
3737
`BasicsTest#test_default_values_are_deeply_dupped`: "flaky",
3838
`CascadedEagerLoadingTest#test_eager_association_loading_with_cascaded_three_levels_by_ping_pong`: "flaky",
39+
`CockroachDBReferentialIntegrityTest#test_should_reraise_invalid_foreign_key_exception_and_show_warning`: "affected by autocommit_before_ddl",
3940
`CockroachDB::AdapterForeignKeyTest#test_foreign_key_violations_are_translated_to_specific_exception_with_validate_false`: "flaky",
4041
`CockroachDB::AdapterForeignKeyTest#test_foreign_key_violations_on_delete_are_translated_to_specific_exception`: "flaky",
4142
`CockroachDB::AdapterForeignKeyTest#test_foreign_key_violations_on_insert_are_translated_to_specific_exception`: "flaky",

0 commit comments

Comments
 (0)