activerecord-cockroachdb-adapter 0.3.0.beta1 → 5.2.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48ca5207eae1d4bf1c26da960ad80e78f54099b1eb62466e89ff5186c9d41632
4
- data.tar.gz: d3d8a5c38a3adda552b283663d4aaf88e05587b3ac9e0da28418fa05d72cfcdd
3
+ metadata.gz: ce049d6cebd6b2024fe869221ab66233f8b529c00acd33020733c8e6a4d2721f
4
+ data.tar.gz: 4f2f4442b80029ad6954fc3231350ce0a22a4d984c31d1db8ddc454b1f558d71
5
5
  SHA512:
6
- metadata.gz: 955dca7f67f68b93fd2ebd19cd6027de446598c823abbc108ce5630fbf6d566c14c09e283f37e3d04fb306ff72a68e55f6856daea91a61f9488636f9da957920
7
- data.tar.gz: 9cb056da8d37cd199427f2ae25d354bcb3fb606fde92e1c01fb2cef7eedd2122a9eccbf0b3693d7d0c7197f8ff8d7d4b1321d16d9212db4331673ddf5669b934
6
+ metadata.gz: d9ce3b5f71d8a342350781ebfad293cd4d152e7cffe432591f09383f32eb52322a2e7c0011ce665ce6c6331b5c1012d61729b7d377b3468bd626a7023b7c04fe
7
+ data.tar.gz: d9013df894826c090485affc94d66df70d2ac79ac48d85ffe305598c2decaf217ab317d5c86a0a794d096bd309cfaf14c9a671f96d26dece5b37b031913fe4e9
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
@@ -46,19 +46,31 @@ Using [bundler](http://bundler.io/), install the dependancies of Rails.
46
46
  bundle install
47
47
  ```
48
48
 
49
- Then, to run the full ActiveRecord test suite with an active CockroachDB instance:
49
+ Then, to run the full test suite with an active CockroachDB instance:
50
50
 
51
51
  ```bash
52
52
  bundle exec rake test
53
53
  ```
54
54
 
55
- To run specific tests, set environemnt variable `TEST_FILES_AR`. For example, to run ActiveRecord tests `test/cases/associations_test.rb` and `test/cases/ar_schema_test.rb.rb`
55
+ To run specific ActiveRecord tests, set environemnt variable `TEST_FILES_AR`. For example, to run ActiveRecord tests `test/cases/associations_test.rb` and `test/cases/ar_schema_test.rb.rb`
56
56
 
57
57
  ```bash
58
58
  TEST_FILES_AR="test/cases/associations_test.rb,test/cases/ar_schema_test.rb" bundle exec rake test
59
59
  ```
60
60
 
61
- By default, tests will be run from the bundled version of Rails. To run against a local copy, set environemnt variable `RAILS_SOURCE`.
61
+ To run specific CockroachDB Adapter tests, set environemnt variable `TEST_FILES`. For example, to run CockroachDB Adpater tests `test/cases/adapter_test.rb` and `test/cases/associations/left_outer_join_association_test.rb`
62
+
63
+ ```bash
64
+ TEST_FILES="test/cases/adapter_test.rb,test/cases/associations/left_outer_join_association_test.rb" bundle exec rake test
65
+ ```
66
+
67
+ To run a specific test case, use minitest's `-n` option to run tests that match a given pattern. All minitest options are set via the `TESTOPTS` environemnt variable. For example, to run `test_indexes` from CockroachDB's `test/cases/adapter_test.rb` file
68
+
69
+ ```bash
70
+ TEST_FILES="test/cases/adapter_test.rb" TESTOPTS=`-n=/test_indexes/` bundle exec rake test
71
+ ```
72
+
73
+ By default, tests will be run from the bundled version of Rails. To run against a local copy, set environemnt variable `RAILS_SOURCE`. Running against a local copy of Rails can be helpful when try to debug issues.
62
74
 
63
75
  ```bash
64
76
  RAILS_SOURCE="path/to/local_copy" bundle exec rake test
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "activerecord-cockroachdb-adapter"
7
- spec.version = "0.3.0.beta1"
7
+ spec.version = "5.2.0.beta2"
8
8
  spec.licenses = ["Apache-2.0"]
9
9
  spec.authors = ["Cockroach Labs"]
10
10
  spec.email = ["cockroach-db@googlegroups.com"]
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- set -euo pipefail
3
+ set -euox pipefail
4
4
 
5
5
  # Download CockroachDB
6
- VERSION=v20.1.0-rc.1
6
+ VERSION=v20.1.0-rc.2
7
7
  wget -qO- https://binaries.cockroachdb.com/cockroach-$VERSION.linux-amd64.tgz | tar xvz
8
8
  readonly COCKROACH=./cockroach-$VERSION.linux-amd64/cockroach
9
9
 
@@ -21,7 +21,7 @@ run_cockroach() {
21
21
  cockroach quit --insecure || true
22
22
  rm -rf cockroach-data
23
23
  # Start CockroachDB.
24
- cockroach start --insecure --host=localhost --listening-url-file="$urlfile" >/dev/null 2>&1 &
24
+ cockroach start-single-node --max-sql-memory=25% --cache=25% --insecure --host=localhost --listening-url-file="$urlfile" >/dev/null 2>&1 &
25
25
  # Ensure CockroachDB is stopped on script exit.
26
26
  trap "echo 'Exit routine: Killing CockroachDB.' && kill -9 $! &> /dev/null" EXIT
27
27
  # Wait until CockroachDB has started.
@@ -33,6 +33,9 @@ run_cockroach() {
33
33
  done
34
34
  cockroach sql --insecure -e 'CREATE DATABASE activerecord_unittest;'
35
35
  cockroach sql --insecure -e 'CREATE DATABASE activerecord_unittest2;'
36
+ cockroach sql --insecure -e 'SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;'
37
+ cockroach sql --insecure -e 'SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;'
38
+ cockroach sql --insecure -e "SET CLUSTER SETTING jobs.retention_time = '180s';"
36
39
  }
37
40
 
38
41
  # Install ruby dependencies.
@@ -41,7 +44,7 @@ bundle install
41
44
 
42
45
  run_cockroach
43
46
 
44
- if ! (bundle exec rake test); then
47
+ if ! (RUBYOPT="-W0" TESTOPTS="-v" bundle exec rake test); then
45
48
  echo "Tests failed"
46
49
  HAS_FAILED=1
47
50
  else
data/docker.sh CHANGED
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # This file is largely cargo-culted from cockroachdb/cockroach/build/builder.sh.
4
4
 
5
- set -euo pipefail
5
+ set -euox pipefail
6
6
 
7
7
  DOCKER_IMAGE_TAG=activerecord_test_container
8
8
 
@@ -56,6 +56,10 @@ module ActiveRecord
56
56
  100000
57
57
  end
58
58
 
59
+ def supports_bulk_alter?
60
+ false
61
+ end
62
+
59
63
  def supports_json?
60
64
  # FIXME(joey): Add a version check.
61
65
  true
@@ -103,8 +107,7 @@ module ActiveRecord
103
107
  end
104
108
 
105
109
  def supports_advisory_locks?
106
- # FIXME(joey): We may want to make this false.
107
- true
110
+ false
108
111
  end
109
112
 
110
113
  def supports_virtual_columns?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-cockroachdb-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.beta1
4
+ version: 5.2.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cockroach Labs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-17 00:00:00.000000000 Z
11
+ date: 2020-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord