Skip to content

Commit

Permalink
Change referenced issue in create_unlogged_tables_test and remove tes…
Browse files Browse the repository at this point in the history
…t override.
  • Loading branch information
keithdoggett committed Jul 6, 2021
1 parent e79f0c3 commit 78ee332
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
16 changes: 2 additions & 14 deletions test/cases/create_unlogged_tables_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,15 @@ def setup
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.create_unlogged_tables = false
end

# Cockroachdb has an issue about `pg_class`
# https://github.com/cockroachdb/cockroach/issues/56656
# This override can be removed after it be fix
# Cockroachdb ignores the UNLOGGED specifier.
# https://github.com/cockroachdb/cockroach/issues/56827
def test_unlogged_in_test_environment_when_unlogged_setting_enabled
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.create_unlogged_tables = true

@connection.create_table(TABLE_NAME) do |t|
end
assert_equal @connection.execute(LOGGED_QUERY).first[LOGGED_FIELD], LOGGED
end

# Cockroachdb has an issue about `pg_class`
# https://github.com/cockroachdb/cockroach/issues/56656
# This override can be removed after it be fix
def test_gracefully_handles_temporary_tables
@connection.execute("SET experimental_enable_temp_tables = 'on';")
@connection.create_table(TABLE_NAME, temporary: true) do |t|
end

assert_equal @connection.execute(LOGGED_QUERY).first[LOGGED_FIELD], TEMPORARY
end
end
end
end
2 changes: 1 addition & 1 deletion test/excludes/CommentTest.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
exclude :test_remove_comment_from_column, "The test fails because altered columns cannot change comments. We implement our own version."
exclude :test_schema_dump_with_comments, "The test fails because altered columns cannot change comments. We implement our own version."
exclude :test_schema_dump_with_comments, "The test fails because altered columns cannot change comments. We implement our own version."
3 changes: 1 addition & 2 deletions test/excludes/UnloggedTablesTest.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
exclude :test_gracefully_handles_temporary_tables, "This override can be removed after it be fix. Related https://github.com/cockroachdb/cockroach/issues/56656"
exclude :test_unlogged_in_test_environment_when_unlogged_setting_enabled, "This override can be removed after it be fix. Related https://github.com/cockroachdb/cockroach/issues/56656"
exclude :test_unlogged_in_test_environment_when_unlogged_setting_enabled, "Override because UNLOGGED cannot be specified in CockroachDB. Related https://github.com/cockroachdb/cockroach/issues/56827"

0 comments on commit 78ee332

Please sign in to comment.