| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
If execute PostgreSQL test with specifying 53853 for seed, the following
error will occur.
```
1) Error:
TransactionTest#test_restore_custom_primary_key_after_rollback:
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "movies_pkey"
DETAIL: Key (movieid)=(2) already exists.
: INSERT INTO "movies" ("name") VALUES ($1) RETURNING "movieid"
```
travis is here https://travis-ci.org/rails/rails/jobs/254095918
As with #29287, it seems like a problem that the value of primary key
obtained from connection gets different.
Therefore, fixed to execute that test within transaction.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This fixes the following failures.
https://travis-ci.org/rails/rails/jobs/253990014
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
y-yagi/insert_environment_value_to_table_before_check_environment
Insert environment value to `InternalMetadata` table before check environment
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Sometimes `ActiveRecord::DatabaseTasksUtilsTask#test_raises_an_error_when_called_with_protected_environment`
test fails.
https://travis-ci.org/rails/rails/jobs/238861562
https://travis-ci.org/rails/rails/jobs/239950092
There seems to be an error because `environment` value is not exist.
This is because did not set the environment after recreating the
table in `SchemaMigrationsTest#test_initializes_internal_metadata_for_encoding_utf8mb4`.
Therefore, we create value after the test to maintain the original state.
|
| | | | | | | | |
|
| |\ \ \ \ \ \ \ |
|
| | |/ / / / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
to address `Mysql2BooleanTest#test_column_type_without_emulated_booleans`
failure
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Without this, test fails because the load schema when pluck is executed.
Steps to reproduce:
```
bin/test -a postgresql -w --seed 61689 test/cases/*test.rb -n "/^(?:InheritanceComputeTypeTest#(?:test_inheritance_new_with_subclass_as_default)|CalculationsTest#(?:test_pluck_loaded_relation))$/"
# Running:
.F
Failure:
CalculationsTest#test_pluck_loaded_relation [/home/yaginuma/program/rails/master_y_yagi/rails/activerecord/test/cases/calculations_test.rb:722]:
1 instead of 0 queries were executed.
Queries:
SELECT c.relname FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = ANY (current_schemas(false)) AND c.relname = 'companies' AND c.relkind IN ('r','v','m').
Expected: 0
Actual: 1
bin/test test/cases/calculations_test.rb:7
```
|
| |\ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Explicitly clear type map before run `test_only_reload_type_map_once_for_every_unknown_type`
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
`test_only_reload_type_map_once_for_every_unknown_type`
Currently, the following test fails.
```
bin/test -a sqlite3_mem --seed 37473 test/cases/relation_test.rb
```
This is due to reset connection in `test_respond_to_for_non_selected_element` postprocessing.
This reset is added with #29332 for `test_only_reload_type_map_once_for_every_unknown_type`.
Since the above test expects the type map to be empty at the time of
test run, I think that it is better to empty the type map before test run.
|
| |/ / / / / / / |
|
| |\ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Clean up `type_map` at the end of test_respond_to_for_non_selected_element
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
`test_only_reload_type_map_once_for_every_unknown_type` expects no
one already registers unknown OID to `type_map`. However,
`test_respond_to_for_non_selected_element` registers it and does not clean up it.
Addresses #29331 at unlock-minitest branch
|
| |\ \ \ \ \ \ \ \
| | |/ / / / / / /
| |/| | | | | | | |
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Creating a new class for widgets was causing failing tests because it
clashed with other widget classes. This test does not need to create its
own class, so I changed it to an existing class.
```
ARCONN=mysql2 bin/test --seed 25364 test/cases/*test.rb -n \
"/^(?:PrimaryKeyIntegerTest#(?:test_primary_key_with_serial_integer_are_automatically_numbered)|PersistenceTest::SaveTest#(?:test_save_touch_false))$/"
```
|
| |\ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Fix random minitest error: database_statements_test
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
The primary key sequence for each test in FixturesResetPkSequenceTest is
reset.
The state in some of the FixturesResetPkSequenceTest tests are leaking,
causing failurse in others. Using a seed of `48104`, the
`FixturesResetPkSequenceTest#test_resets_to_min_pk_with_specified_pk_and_sequence`
runs before the `DatabaseStatementsTest` tests, and
the tests fail with duplicate primary key errors:
```
Run options: --seed 48104 -n
"/^(?:FixturesResetPkSequenceTest#(?:test_resets_to_min_pk_with_specified_pk_and_sequence)|DatabaseStatementsTest#(?:test_create_should_return_the_inserted_id|test_exec_insert|test_insert_should_return_the_inserted_id))$/"
.EEE
1) Error:
DatabaseStatementsTest#test_exec_insert:
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate
key value violates unique constraint "accounts_pkey"
DETAIL: Key (id)=(2) already exists.
2) Error:
DatabaseStatementsTest#test_create_should_return_the_inserted_id:
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate
key value violates unique constraint "accounts_pkey"
DETAIL: Key (id)=(3) already exists.
3) Error:
DatabaseStatementsTest#test_insert_should_return_the_inserted_id:
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate
key value violates unique constraint "accounts_pkey"
DETAIL: Key (id)=(4) already exists.
```
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Ensure that the fixtures are properly loaded for FoxyFixturesTest
When tests are randomized, FoxyFixturesTest often fails due to unloaded
fixtures.
|
| |/ / / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
If keep the extension, can not test properly to make sure that
extension can be enabled.
|
| |\ \ \ \ \ \ \ \ |
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
`DefaultScopingWithThreadTest` expects that there are two or more of
`developers` data, but have not created data in the test.
Therefore, tests may fail depending on execution order.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
This will make sure it doesn't change the state of the current proccess
when removing the owners constant.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
This will avoid us to close the connection of the saved connection pool.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
- The test `PrimaryKeyAnyTypeTest#test_any_type_primary_key` was failing
if ran after running all tests from `CompositePrimaryKeyTest`.
- This was happening because `CompositePrimaryKeyTest` was changing the
primary key of the barcodes table which was cached in schema cache.
- As we were always going to drop the `barcodes` table at the end of
tests in both `PrimaryKeyTest` and `CompositePrimaryKeyTest`, solved
this issue by using different table name for tests in
`CompositePrimaryKeyTest`.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Reproduction command -
ARCONN=postgresql be ruby -w -Itest test/cases/autosave_association_test.rb --seed 34101
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
- Tried specifying `id` for the `readers` records but it is
interconnected with so many tests that many random tests started
failing.
- So switched to the approach of deleting all readers in the
`create_resets_cached_counters` test.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
- In earlier commit, I removed setting id manually for readers fixtures
but that did not fix the randomly failing
test_create_resets_cached_counters
from has_many_associations tests.
- Because the problem was with the `person_id` of the readers. As it is
set to 1 in fixtures, if a post gets created with id 1 then that post
automatically has 2 readers.
- Fixed by removing the person_id.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
- This causes failures in the `test_create_resets_cached_counters` from
the has_many_associations tests because sometimes a Post record gets
created with id as 1 so the readers records get associated with it and
`person.readers` returns these 2 records instead of empty array.
- Better to just remove the ids.
|
|\ \ \ \ \ \ \ \ \ \
| |_|_|_|_|/ / / / /
|/| | | | | | | | | |
Sync transaction state when accessing primary key
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
If a record is modified inside a transaction, it must check the outcome
of that transaction before accessing any state which would no longer be
valid if it was rolled back.
For example, consider a new record that was saved inside a transaction
which was later rolled back: it should be restored to its previous state
so that saving it again inserts a new row into the database instead of
trying to update a row that no longer exists.
The `id` and `id=` methods defined on the PrimaryKey module implement
this correctly, but when a model uses a custom primary key, the reader
and writer methods for that attribute must check the transaction state
too. The `read_attribute` and `write_attribute` methods also need to
check the transaction state when accessing the primary key.
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Remove redundant `unless current_adapter?(:OracleAdapter)`
|
| | | | | | | | | | | |
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
And make reference to `Relation`.
|
|\ \ \ \ \ \ \ \ \ \ \
| |_|_|_|_|_|_|_|_|/ /
|/| | | | | | | | | | |
Avoid duplicate clauses when using #or
|
| | | | | | | | | | | |
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Condenses the clauses that are common to both sides of the OR and put them outside, before the OR
This fix the current behavior where the number of conditions is exponential based on the number of times #or is used.
|
| |_|_|_|_|_|_|_|_|/
|/| | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
It seems that it accepts only HTTPS connections.
Ref: https://github.com/postgres/postgres/commit/7f77cbd996855a06fb742ea11adbe55c42b48fe2
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Building `where_clause` in `UniquenessValidator` is no longer needed
|
| |/ / / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Building `where_clause` manually was introduced at #26073 to include
both `comparison` and `binds` in `where_clause`. Since 213796f,
`comparison` includes `binds`, so it is enough to use `where` simply.
|
| |/ / / / / / / /
|/| | | | | | | |
| | | | | | | | |
| | | | | | | | | |
For less duplicated code.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
We were expecting those classes to be loaded when an association is
defined but they are not.
If you add a debugger on the first line of any of those classes and try
to define the corresponding association you will see that the classes
are not loaded.
Fixes #26273
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Fix an AR test of schema dump when using Oracle
|
| | | | | | | | | | |
|
| |/ / / / / / / /
|/| | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Anywhere that we're doing `self.class.unscoped.where(primary_key => id)`
is somewhere that someone may want to extend. Even if this method isn't
public API yet, this will make it easier for us to eventually expose an
API around this. Plus, duplicated code makes me sad.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Remove single element array preprocess
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Since 213796f, array predicate handler supports making binds, so the
preprocess is no longer needed.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
The limit option is ignored by PostgreSQL and may be ignored by 3rd
party backends. Make this clear in the docs. Fixes #29922.
|
|/ / / / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Note that the two relations must still have the same `includes` values
(which is the only time `references` actually does anything). It makes
sense for us to allow this, as `references` is called implicitly when
passing a hash to `where`.
Fixes #29411
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Without this change, bundler will resolve a gemfile which is pointing at
Rails master and not arel master. The error message that someone will
get from doing this will be incredibly unhelpful, as it'll be the result
of ActiveRecord being in a half-loaded that halted at `require
"arel/collectors/composite"`, which was subsequently rescued in
`"rails/all"`
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Remove useless `JoinInformation`
|