Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minitest system tests trying to use app_db.solid_errors table #65

Open
janpeterka opened this issue Sep 23, 2024 · 2 comments
Open

Minitest system tests trying to use app_db.solid_errors table #65

janpeterka opened this issue Sep 23, 2024 · 2 comments

Comments

@janpeterka
Copy link

Hi, I added SolidError to my app, and when I run failing minitest system test, I get

Error:
EventsTest#test_showing_dialog_with_day_details:
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'kucharka_test.solid_errors' doesn't exist

and not getting the real error message (in this case RecordNotFound).

Maybe I miscofigured something, but I mostly followed the default instructions.

Thanks for help!

What I tried:

  • removing gem from Gemfile helps
  • removing configuration lines from production and development doesn't
@ChadMoran
Copy link

I haven't looked into this and haven't had time but I think it has to do with the test DB not being configured the same way as prod and development. The error is happening and solid_errors is expecting it to be. In test solid_errors likely needs to be disabled somehow.

@antonioJASR
Copy link

antonioJASR commented Jan 17, 2025

I imagine later will be an option to be disabled in test environments. Meanwhile I added in my config/environments/test.rb file the following:

Rails.application.configure do
# ...

  config.solid_errors.connects_to = { database: { writing: :errors }
end

And inside the config/database.yml file:

test:
  primary:
    <<: *default
    database: data/test_data.sqlite3
  errors:
    <<: *default
    database: data/test_errors.sqlite3
    migrations_paths: db/errors_migrate

This is working for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants