Skip to content

Commit 29eaaaf

Browse files
committed
sqlite and mysql don't yet support reading records from transactions
this disables the tx read specs for mysql and sqlite
1 parent 1d88a0f commit 29eaaaf

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

.travis.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: crystal
22
script:
3-
- crystal spec
3+
- crystal spec -D $DB_TYPE
44
- crystal tool format --check
55
services:
66
- mysql
@@ -18,11 +18,9 @@ before_script:
1818
- psql -c 'create database crecto_test;' -U postgres
1919
- psql $PG_URL < spec/migrations/pg_migrations.sql
2020
- sqlite3 ./crecto_test.db < spec/migrations/sqlite3_migrations.sql
21-
- if [ ! -z "$PG_URL" ]; then cp ./spec/travis_pg_repo.cr ./spec/repo.cr; fi
22-
- if [ ! -z "$MYSQL_URL" ]; then cp ./spec/travis_mysql_repo.cr ./spec/repo.cr; fi
23-
- if [ ! -z "$SQLITE3_PATH" ]; then cp ./spec/travis_sqlite_repo.cr ./spec/repo.cr; fi
21+
- cp ./spec/travis_${DB_TYPE}_repo.cr ./spec/repo.cr
2422
env:
2523
matrix:
26-
- PG_URL=postgres://postgres@localhost:5432/crecto_test
27-
- MYSQL_URL=mysql://root@localhost/crecto_test
28-
- SQLITE3_PATH=sqlite3://./crecto_test.db
24+
- PG_URL=postgres://postgres@localhost:5432/crecto_test DB_TYPE=pg
25+
- MYSQL_URL=mysql://root@localhost/crecto_test DB_TYPE=mysql
26+
- SQLITE3_PATH=sqlite3://./crecto_test.db DB_TYPE=sqlite

spec/transactions_spec.cr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,12 @@ describe Crecto do
337337
Repo.all(User, Query.where(name: "perform_all_io2oj999")).size.should eq 0
338338
end
339339

340-
it "allows reading records inserted inside the transaction" do
340+
# This only works for postgres for now
341+
{% if flag?(:pg) %}
342+
it "allows reading records inserted inside the transaction" do
343+
{% else %}
344+
pending "allows reading records inserted inside the transaction" do
345+
{% end %}
341346
insert_user = User.new
342347
insert_user.name = "insert_user"
343348

0 commit comments

Comments
 (0)