Closed 3zcurdia closed 3 months ago
If I change in the CI config file it to rails db:setup
the error is as follow
Run bin/rails db:setup
/home/runner/work/app/app/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30: warning: /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/csv.rb was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec.
Created database 'db/test.sqlite3'
bin/rails aborted!
NoMethodError: undefined method `search_index' for an instance of SQLite3::Database (NoMethodError)
Duh my database.ci.yml
had the wrong config
test:
adapter: litedb
database: <%= Litesupport.root("test").join("data.sqlite3") %>
pool: 5
timeout: 5000
That fix it 🤡
I'm having this same issue. My database.yml test stanza is just like yours too. I've not been able to resolve this yet.
So, I've figured out the source of my problem. my github action yml file had this environment variable in it:
DATABASE_URL: "sqlite3:db/test/data.sqlite3"
That was causing ActiveRecord to have a native SQLite database connection instead of a Litedb connection. Rails will always give preference to DATABASE_URL for establishing a database connection. So removing allowed the test db settings in database.yml to b e applied.
While running the tests on GitHub the following error appears in a rails application
it seems to be related to a missing SQLite file missing on the CI here is my GitHub Actions file