railwatch 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/generators/railwatch/install/install_generator.rb +15 -1
- data/lib/railwatch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c88b489c82195c106d414c397d391d8cf2e8d3e499dd67715d3db14fc4f7dae
|
|
4
|
+
data.tar.gz: 3a2bb00def3c244d0eb9630f1eb6b3d4fddb29ea17cf34e2c8023123c92bdaf3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f616d461f05f956503d2fa37d20dd238f98f1f77624665e6c352c675b9df12704b2a912e15b8bcf6d992192a86016b3ee39e8924b7b4a70d9bbe24f61d5c4845
|
|
7
|
+
data.tar.gz: 8d372cfaed4dd585b39a8bbd6f042b9af6bada233e92dc7e0021613507e6bc0d570cc120bce4f1f5ef163c223ea8855a730781c16bc5fd34321a9cff10020607
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.3 (2026-09-19)
|
|
4
|
+
|
|
5
|
+
- Fix `railwatch:install --local` writing test databases that parallel test
|
|
6
|
+
runners cannot share. The generated `test` entries named
|
|
7
|
+
`storage/test_railwatch*.sqlite3` with no `TEST_ENV_NUMBER`, so every worker
|
|
8
|
+
in a parallel run opened the same two SQLite files and raced through them:
|
|
9
|
+
`ActiveRecord::PendingMigrationError` and `SQLite3::IOException: disk I/O
|
|
10
|
+
error` out of `configure_connection`, on every shard. Rails' own test
|
|
11
|
+
database naming carries the number for this reason, and the generated names
|
|
12
|
+
now do too. An app with no parallel runner sets no `TEST_ENV_NUMBER`, so its
|
|
13
|
+
generated file is unchanged and no existing install needs migrating.
|
|
14
|
+
|
|
3
15
|
## 0.3.2 (2026-09-19)
|
|
4
16
|
|
|
5
17
|
- Fix an embedded install's rake tasks reporting over HTTP instead of into
|
|
@@ -383,12 +383,26 @@ module Railwatch
|
|
|
383
383
|
lines.insert(start + 1, " primary:\n")
|
|
384
384
|
stop += 1
|
|
385
385
|
end
|
|
386
|
-
entries = format(RAILWATCH_DATABASES, env: env).lines.map { |line| " #{line}" }
|
|
386
|
+
entries = format(RAILWATCH_DATABASES, env: database_prefix(env)).lines.map { |line| " #{line}" }
|
|
387
387
|
lines = insert_lines(lines, stop, entries.join).lines
|
|
388
388
|
end
|
|
389
389
|
lines.join
|
|
390
390
|
end
|
|
391
391
|
|
|
392
|
+
# What the database filenames are built from. For test that has to carry
|
|
393
|
+
# TEST_ENV_NUMBER, the way Rails' own test database naming does: runners
|
|
394
|
+
# like parallel_tests give each worker its own number and expect a
|
|
395
|
+
# database per worker. Without it every worker in a run opens the same
|
|
396
|
+
# two SQLite files and they fight over them -- observed as
|
|
397
|
+
# PendingMigrationError and "disk I/O error" from configure_connection,
|
|
398
|
+
# on an app running four workers. An app with no such runner sets no
|
|
399
|
+
# TEST_ENV_NUMBER, so the suffix is empty and the name is unchanged.
|
|
400
|
+
def self.database_prefix(env)
|
|
401
|
+
return env unless env == "test"
|
|
402
|
+
|
|
403
|
+
%(test<%= ENV["TEST_ENV_NUMBER"] %>)
|
|
404
|
+
end
|
|
405
|
+
|
|
392
406
|
# Unconditional: `bundle exec puma` evaluates this file before it loads
|
|
393
407
|
# the Rack app, so `if defined?(Railwatch)` would be false there and the
|
|
394
408
|
# writer would never start. The plugin itself is inert when Railwatch is
|
data/lib/railwatch/version.rb
CHANGED