Skip to content

Commit

Permalink
Eager-load classes in CI so we mimic production
Browse files Browse the repository at this point in the history
  • Loading branch information
rosa committed May 22, 2024
1 parent f9bd357 commit 2a69a27
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- 33306:3306
env:
TARGET_DB: ${{ matrix.database }}
CI: true
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions lib/console1984/commands/decrypt.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "irb/command"

module Console1984::Commands
class Decrypt < IRB::Command::Base
include Console1984::Ext::Irb::Commands
Expand Down
2 changes: 2 additions & 0 deletions lib/console1984/commands/encrypt.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "irb/command"

module Console1984::Commands
class Encrypt < IRB::Command::Base
include Console1984::Ext::Irb::Commands
Expand Down
1 change: 0 additions & 1 deletion lib/console1984/ext/irb/commands.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Add Console 1984 commands to IRB sessions.
module Console1984::Ext::Irb::Commands
include Console1984::Freezeable

Expand Down
2 changes: 1 addition & 1 deletion test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def current

class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
config.load_defaults 7.0

# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
Expand Down
8 changes: 4 additions & 4 deletions test/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
config.cache_classes = false
config.action_view.cache_template_loading = true

# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Eager loading loads your whole application. When running a single test locally,
# this probably isn't necessary. It's a good idea to do in a continuous integration
# system, or in some way before deploying your code.
config.eager_load = ENV["CI"].present?

# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
Expand Down

0 comments on commit 2a69a27

Please sign in to comment.