Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpoly committed Jun 11, 2024
1 parent 9b0c3cc commit 026d1fe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 34 deletions.
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,16 @@ GEM
json (2.7.2)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
litestream (0.10.1)
litestream (0.10.3)
logfmt (>= 0.0.10)
sqlite3
litestream (0.10.1-arm64-darwin)
litestream (0.10.3-arm64-darwin)
logfmt (>= 0.0.10)
sqlite3
litestream (0.10.1-x86_64-darwin)
litestream (0.10.3-x86_64-darwin)
logfmt (>= 0.0.10)
sqlite3
litestream (0.10.1-x86_64-linux)
litestream (0.10.3-x86_64-linux)
logfmt (>= 0.0.10)
sqlite3
logfmt (0.0.10)
Expand Down Expand Up @@ -248,7 +248,7 @@ GEM
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
pagy (6.5.0)
parallel (1.24.0)
parallel (1.25.1)
parser (3.3.2.0)
ast (~> 2.4.1)
racc
Expand All @@ -265,7 +265,7 @@ GEM
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.8.0)
rack (3.0.11)
rack (3.1.0)
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
rack-proxy (0.7.7)
Expand Down Expand Up @@ -321,8 +321,8 @@ GEM
regexp_parser (2.9.2)
reline (0.5.8)
io-console (~> 0.5)
rexml (3.2.8)
strscan (>= 3.0.9)
rexml (3.3.0)
strscan
rubocop (1.63.5)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
Expand Down Expand Up @@ -366,7 +366,7 @@ GEM
concurrent-ruby (>= 1.3.1)
fugit (~> 1.11.0)
railties (>= 7.1)
sorbet-runtime (0.5.11376)
sorbet-runtime (0.5.11428)
sqlite3 (1.7.3-aarch64-linux)
sqlite3 (1.7.3-arm64-darwin)
sqlite3 (1.7.3-x86_64-darwin)
Expand Down
2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
default: &default
adapter: sqlite3
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 10 } %>
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000

# DATABASE CONFIGURATIONS
Expand Down
2 changes: 1 addition & 1 deletion config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 3 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count

Expand Down
22 changes: 0 additions & 22 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
## This file should ensure the existence of records required to run the application in every environment (production,
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
#
# Example:
#
# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
# MovieGenre.find_or_create_by!(name: genre_name)
# end

# open the yaml file in ../data/rails_conf_2021.yml

# scp [email protected]:/var/lib/docker/volumes/storage/_data/production_rubyvideo.sqlite3 /storage/backup/production_rubyvideo.sqlite3

# if Rails.env.development?
# SpeakerTalk.delete_all
# Speaker.delete_all
# Talk.delete_all
# Event.delete_all
# Organisation.delete_all
# end

speakers = YAML.load_file("#{Rails.root}/data/speakers.yml")
organisations = YAML.load_file("#{Rails.root}/data/organisations.yml")
videos_to_ignore = YAML.load_file("#{Rails.root}/data/videos_to_ignore.yml")
Expand Down
3 changes: 2 additions & 1 deletion test/tasks/db_seed_test.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
require "test_helper"

class DbSeedTest < ActiveSupport::TestCase
self.use_transactional_tests = false # don't use fixtures for this test

setup do
@event = events(:one)
Rails.application.load_tasks
Rake::Task["db:environment:set"].reenable
Rake::Task["db:schema:load"].invoke
Expand Down

0 comments on commit 026d1fe

Please sign in to comment.