You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It was using old and invalid SQL statements. I took that
opportunity to also change a bit its behaviour:
- Remove the related rake task and automatically cache
the schema if non-existent.
- Cache every databases used in tests.
- Ensure that cache name is based on schema files.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-17Lines changed: 10 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,23 +61,16 @@ Only do it if you know the schema was left in a correct state.
61
61
62
62
### Run Tests from a Backup
63
63
64
-
Loading the full test schema every time a test runs can take a while, so for cases where loading the schema sequentially is unimportant, it is possible to use a backup to set up the database. This is significantly faster than the standard method and is provided to run individual tests faster, but should not be used to validate a build.
65
-
66
-
First create the template database.
67
-
68
-
```bash
69
-
bundle exec rake db:create_test_template
70
-
```
71
-
72
-
This will create a template database for the current version (ex. `activerecord_test_template611` for version 6.1.1) and create a `BACKUP` in the `nodelocal://self/activerecord-crdb-adapter/#{activerecord_version}` directory.
73
-
74
-
To load from the template, use the `COCKROACH_LOAD_FROM_TEMPLATE` flag.
75
-
76
-
```bash
77
-
COCKROACH_LOAD_FROM_TEMPLATE=1 TEST_FILES="test/cases/adapters/postgresql/ddl_test.rb" bundle exec rake test
78
-
```
79
-
80
-
And the `activerecord_unittest` database will use the `RESTORE` command to load the schema from the template database.
64
+
Loading the full test schema every time a test runs can take
65
+
a while, so for cases where loading the schema sequentially
66
+
is unimportant, it is possible to use a backup to set up the
67
+
database. This is significantly faster than the standard
68
+
method and is provided to run individual tests faster, but
69
+
should not be used to validate a build.
70
+
71
+
To do so, just set the env variable `COCKROACH_LOAD_FROM_TEMPLATE`.
72
+
First run will generate and cache a template, latter runs will use
0 commit comments