Commit Graph

13 Commits

Author SHA1 Message Date
Grzegorz Bizon 3577009ad8 Increase isolation of database migrations test models 2018-03-29 12:12:00 +02:00
Rémy Coutable f6357b77ff Allow to use the latest migration in migration specs
This is useful for migration tests that relies on factories and that are
very old and/or tedious to modify to not use factories.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-02-12 16:54:21 +01:00
Rémy Coutable 5912d9b70b Call .reset_column_in_all_models! before migrating in MigrationsHelpers.schema_migrate_up!
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-02-12 16:54:21 +01:00
Sean McGivern 77c1d87fea Make resetting column information overridable in EE 2018-02-08 16:31:36 +00:00
Rémy Coutable 0c62b49484
Reset column information after the schema is migrated in MigrationsHelpers.schema_migrate_up!
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-02-07 11:38:50 +01:00
Lin Jen-Shin 82f18eabf3 Reset all connection schema cache after migration tests
We might also want to consider reduce the number of
connections in the tests. However I just tried setting it to 1
and that doesn't seem enough for feature tests.
2017-09-12 02:49:32 +08:00
Grzegorz Bizon db4bd1a67d Clear schema cache after running tests for migrations 2017-08-28 12:49:43 +02:00
Grzegorz Bizon 3a29646d73 Disable migrations output in migrations helpers 2017-08-17 12:34:31 +02:00
Grzegorz Bizon c76f8f3e8f Make it possible to provide schema version in tests 2017-08-16 13:05:18 +02:00
Lin Jen-Shin 4d7c072da3 Reset only migration models
So that we could make sure migration tests could run even if
geo is not setup in EE.

This is because we have a model like this:

``` ruby
class Geo::BaseRegistry < ActiveRecord::Base
  def self.connection
    raise 'Geo secondary database is not configured' unless Gitlab::Geo.geo_database_configured?

    super
  end
end
```
2017-08-07 21:20:26 +08:00
Grzegorz Bizon 028423c2f5 Calculate previous migration version in specs support
This makes it possible to test migration on the schema this migration
was written for, without a need to specify a previous schema version
manually.
2017-06-05 11:07:10 +02:00
Grzegorz Bizon 918ababba6 Add pipeline stages post deployment migration 2017-05-26 14:46:45 +02:00
Grzegorz Bizon 0f9fbae78a Add migrations helpers to simplify writing migration specs 2017-05-26 10:36:01 +02:00