Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ jobs:
bundler-cache: true
- name: Run the default task
run: bin/rake
- name: Full mutant run
run: bin/mutant run
2 changes: 1 addition & 1 deletion .mutant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requires:
- connection_pool
- en57
integration:
name: minitest
name: tldr
matcher:
subjects:
- En57*
Expand Down
2 changes: 2 additions & 0 deletions .tldr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
helper_paths:
- test/test_helper.rb
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ gemspec
gem "bigdecimal"
gem "irb"
gem "rake"
gem "m"
gem "minitest"
gem "minitest-mock"
gem "mutant-minitest"
gem "concurrent-ruby"
gem "tldr"
gem "mutant", github: "mostlyobvious/mutant"
gem "mutant-tldr", github: "mostlyobvious/mutant"
gem "pg-ephemeral"
gem "syntax_tree"

Expand Down
60 changes: 38 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
GIT
remote: https://github.com/mostlyobvious/mutant.git
revision: f6b6f88a0c766916a2c221892ae00e397810d83f
specs:
mutant (0.16.2)
diff-lcs (>= 1.6, < 3)
irb (~> 1.15)
parser (~> 3.3.10)
regexp_parser (~> 2.10)
securerandom (>= 0.3)
sorbet-runtime (~> 0.6.0)
unparser (>= 0.8.2, < 0.10)
mutant-tldr (0.16.2)
mutant (= 0.16.2)
tldr (~> 1.0)

PATH
remote: .
specs:
Expand Down Expand Up @@ -27,6 +43,7 @@ GEM
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.3)
attr_extras (7.1.0)
base64 (0.3.0)
bigdecimal (4.1.2)
concurrent-ruby (1.3.6)
Expand All @@ -45,28 +62,16 @@ GEM
reline (>= 0.4.2)
json (2.19.4)
logger (1.7.0)
m (1.7.0)
rake
minitest (6.0.5)
drb (~> 2.0)
prism (~> 1.5)
minitest-mock (5.27.0)
mutant (0.16.2)
diff-lcs (>= 1.6, < 3)
irb (~> 1.15)
parser (~> 3.3.10)
regexp_parser (~> 2.10)
securerandom (>= 0.3)
sorbet-runtime (~> 0.6.0)
unparser (>= 0.8.2, < 0.10)
mutant-minitest (0.16.2)
minitest (>= 5.11, < 7)
mutant (= 0.16.2)
mutex_m (~> 0.2)
mutex_m (0.3.0)
optimist (3.2.1)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
patience_diff (1.2.0)
optimist (~> 3.0)
pg (1.6.3)
pg (1.6.3-aarch64-linux)
pg (1.6.3-arm64-darwin)
Expand Down Expand Up @@ -99,9 +104,17 @@ GEM
bigdecimal
sorbet-runtime (0.6.13169)
stringio (3.2.0)
super_diff (0.18.0)
attr_extras (>= 6.2.4)
diff-lcs
patience_diff
syntax_tree (6.3.0)
prettier_print (>= 1.2.0)
timeout (0.6.1)
tldr (1.1.1)
concurrent-ruby (~> 1.2)
irb (~> 1.10)
super_diff (~> 0.10)
tsort (0.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand All @@ -123,20 +136,21 @@ DEPENDENCIES
connection_pool
en57!
irb
m
minitest
minitest-mock
mutant-minitest
mutant!
mutant-tldr!
pg-ephemeral
rake
sequel
syntax_tree
tldr

CHECKSUMS
activemodel (8.1.3) sha256=90c05cbe4cef3649b8f79f13016191ea94c4525ce4a5c0fb7ef909c4b91c8219
activerecord (8.1.3) sha256=8003be7b2466ba0a2a670e603eeb0a61dd66058fccecfc49901e775260ac70ab
activesupport (8.1.3) sha256=21a5e0dfbd4c3ddd9e1317ec6a4d782fa226e7867dc70b0743acda81a1dca20e
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
attr_extras (7.1.0) sha256=d96fc9a9dd5d85ba2d37762440a816f840093959ae26bb90da994c2d9f1fc827
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785
Expand All @@ -152,13 +166,13 @@ CHECKSUMS
irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3
json (2.19.4) sha256=670a7d333fb3b18ca5b29cb255eb7bef099e40d88c02c80bd42a3f30fe5239ac
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
m (1.7.0) sha256=058f793da8150c51353cc59366ffae7774683e868bede3c78f81d920fb9d633a
minitest (6.0.5) sha256=f007d7246bf4feea549502842cd7c6aba8851cdc9c90ba06de9c476c0d01155c
minitest-mock (5.27.0) sha256=7040ed7185417a966920987eaa6eaf1be4ea1fc5b25bb03ff4703f98564a55b0
mutant (0.16.2) sha256=0e9678652093d9fa134f7828f7cdce2b19e322370b2f184f7dcdacf1b70f38e5
mutant-minitest (0.16.2) sha256=041c51cd75b7bd649c4ef3b530f5f329ca8470ece76714143c8520af31606c47
mutex_m (0.3.0) sha256=cfcb04ac16b69c4813777022fdceda24e9f798e48092a2b817eb4c0a782b0751
mutant (0.16.2)
mutant-tldr (0.16.2)
optimist (3.2.1) sha256=8cf8a0fd69f3aa24ab48885d3a666717c27bc3d9edd6e976e18b9d771e72e34e
parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54
patience_diff (1.2.0) sha256=f492094486af02fff4a80070fa6b4d0ebbcf4d42fb38bba29d095eef43f6822c
pg (1.6.3) sha256=1388d0563e13d2758c1089e35e973a3249e955c659592d10e5b77c468f628a99
pg (1.6.3-aarch64-linux) sha256=0698ad563e02383c27510b76bf7d4cd2de19cd1d16a5013f375dd473e4be72ea
pg (1.6.3-arm64-darwin) sha256=7240330b572e6355d7c75a7de535edb5dfcbd6295d9c7777df4d9dddfb8c0e5f
Expand All @@ -180,8 +194,10 @@ CHECKSUMS
sequel (5.103.0) sha256=51bf23374cc585724fc51a2ae8b95283422c97ca4585ce28f3db27a26ce55a69
sorbet-runtime (0.6.13169) sha256=6c520bc1ba75d9d982003d957548ec8a941dfa3c3342322a2db20bc28f174b3e
stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
super_diff (0.18.0) sha256=9f5e77464fa75150619f7783174fbbe1bbac50a1eaf157cd39ad5584b0eac142
syntax_tree (6.3.0) sha256=56e25a9692c798ec94c5442fe94c5e94af76bef91edc8bb02052cbdecf35f13d
timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb
tldr (1.1.1) sha256=fbf6386d9689eee1f18fe2bd5b565bff2b19832dc22fdb02e7acddca220edf8c
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
unparser (0.9.0) sha256=4331f174a73a23b69250b13d47da3794ed1449711ee0f9ed8947dc020ba76067
Expand Down
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

require "bundler/gem_tasks"
require "fileutils"
require "minitest/test_task"
require "tldr/rake"
require "uri"
require_relative "lib/en57/tasks"

Minitest::TestTask.create
desc "Run tests"
task test: :tldr

def pg_regress_bin
candidates = [
Expand Down
4 changes: 2 additions & 2 deletions bin/m → bin/tldr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# This file was generated by Bundler.
#
# The application 'm' is installed as part of a gem, and
# The application 'tldr' is installed as part of a gem, and
# this file is here to facilitate running it.
#

Expand All @@ -13,4 +13,4 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
require "rubygems"
require "bundler/setup"

load Gem.bin_path("m", "m")
load Gem.bin_path("tldr", "tldr")
16 changes: 16 additions & 0 deletions bin/tldt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'tldt' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "rubygems"
require "bundler/setup"

load Gem.bin_path("tldr", "tldt")
2 changes: 1 addition & 1 deletion test/test_active_record_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "test_helper"

module En57
class TestActiveRecordAdapter < Minitest::Test
class TestActiveRecordAdapter < TLDR
cover ActiveRecordAdapter

def test_with_connection_checks_out_connection_and_yields_raw_connection
Expand Down
2 changes: 1 addition & 1 deletion test/test_en57.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "test_helper"

module En57
class TestEn57 < Minitest::Test
class TestEn57 < TLDR
cover En57

def test_that_it_has_a_version_number
Expand Down
2 changes: 1 addition & 1 deletion test/test_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "test_helper"

module En57
class TestEvent < Minitest::Test
class TestEvent < TLDR
cover Event

def test_generates_uuid_v7_by_default
Expand Down
2 changes: 1 addition & 1 deletion test/test_event_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "test_helper"

module En57
class TestEventStore < Minitest::Test
class TestEventStore < TLDR
cover EventStore

def test_append_event
Expand Down
2 changes: 2 additions & 0 deletions test/test_factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

module En57
class TestFactories < IntegrationTest
TLDR.dont_run_these_in_parallel!

def test_for_pg_round_trips_with_connection_uri
assert_round_trip EventStore.for_pg(SERVER.url)
end
Expand Down
13 changes: 8 additions & 5 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

require "minitest/autorun"
require "tldr/autorun"
require "minitest/mock"
require "mutant/minitest/coverage"
require "mutant/tldr/coverage"

# optional dependencies
require "sequel"
Expand All @@ -17,7 +17,7 @@
require "pg_ephemeral"

module En57
class IntegrationTest < Minitest::Test
class IntegrationTest < TLDR
SERVER = PgEphemeral.start

CONNECTION = PG.connect(SERVER.url)
Expand Down Expand Up @@ -49,12 +49,15 @@ def setup =
"TRUNCATE TABLE en57.tags, en57.events RESTART IDENTITY CASCADE",
)

Minitest.after_run do
at_exit do
AR_POOL.disconnect!
SEQUEL_DB.disconnect
PG_POOL.shutdown(&:close)
CONNECTION.close
SERVER.shutdown
begin
SERVER.shutdown
rescue Errno::ECHILD
end
end
end
end
2 changes: 2 additions & 0 deletions test/test_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

module En57
class TestIntegration < IntegrationTest
TLDR.dont_run_these_in_parallel!

ADAPTERS.each do |name, factory|
define_method "test_#{name}_happy_path" do
with_event_store(factory) do |event_store|
Expand Down
2 changes: 1 addition & 1 deletion test/test_json_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require "openssl"

module En57
class TestJsonSerializer < Minitest::Test
class TestJsonSerializer < TLDR
cover JsonSerializer

class Example < Data.define(:name, :value, :serialized, :klass)
Expand Down
2 changes: 2 additions & 0 deletions test/test_migrator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

module En57
class TestMigrator < IntegrationTest
TLDR.dont_run_these_in_parallel!

def test_status_reports_pending_schema_on_empty_database
with_database do |url|
assert_equal(
Expand Down
2 changes: 1 addition & 1 deletion test/test_pg_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "test_helper"

module En57
class TestPgAdapter < Minitest::Test
class TestPgAdapter < TLDR
cover PgAdapter

def test_with_connection_yields_connection
Expand Down
2 changes: 1 addition & 1 deletion test/test_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "test_helper"

module En57
class TestQuery < Minitest::Test
class TestQuery < TLDR
cover Query

def test_refine_last_starts_from_all_item
Expand Down
2 changes: 1 addition & 1 deletion test/test_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "test_helper"

module En57
class TestRepository < Minitest::Test
class TestRepository < TLDR
cover Repository

def test_append_wraps_write_in_serializable_transaction
Expand Down
2 changes: 1 addition & 1 deletion test/test_scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "test_helper"

module En57
class TestScope < Minitest::Test
class TestScope < TLDR
cover Scope

def test_empty_scope_returns_query_all
Expand Down
2 changes: 1 addition & 1 deletion test/test_sequel_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "test_helper"

module En57
class TestSequelAdapter < Minitest::Test
class TestSequelAdapter < TLDR
cover SequelAdapter

def test_with_connection_synchronizes_and_yields_connection
Expand Down
2 changes: 2 additions & 0 deletions test/test_stress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

module En57
class TestStress < IntegrationTest
TLDR.dont_run_these_in_parallel!

ADAPTERS.each do |name, factory|
define_method(
"test_#{name}_only_one_writer_can_consume_account_credits",
Expand Down
Loading