-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add a SQLite job to the CI #4525
Conversation
Hey, @elia, thanks for your PR. Please, see #4019 (comment) |
thanks @waiting-for-dev good call, I'll remove the CI commit and keep the rest. However it seems like the CI took the usual 13min, @kennyadsl can we resume #4019 now? |
@kennyadsl thanks! I'll add that commit to this PR and open for review once green 👍 |
Added a valid user param so that the action is not stopped by strong parameters.
They pass with recent SQLite versions.
'net/http' is required by 'capybara/server', triggering a few "already initialized constant" warnings when loaded from default gems. See: - ruby/net-protocol#10 - https://stackoverflow.com/a/72474475
When running bin/build with the default postgres adapter the DummyApp will interrupt the loading of the spec_helper. This means that the first spec will report the correct error (ActiveRecord::DatabaseConnectionError) but each following spec will try to load the spec_helper again and will report a confusing "Application has been already initialized." error. With this change the original ActiveRecord::DatabaseConnectionError will be reported for every spec, making it easier to fix it.
The SQLite adapter is the default while developing locally and for dummy apps, even if unlikely to be used by anyone in production we need to be sure it keeps working. The test suite was only run against mysql and postgres.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Thanks @elia, these changes look great!
sqlite: | ||
working_directory: *workdir | ||
environment: | ||
<<: *environment | ||
DB: sqlite | ||
docker: | ||
- image: *image | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should add this to the https://github.com/solidusio/circleci-orbs-extensions repo as well so extensions also can opt-in to running specs against SQLite on CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in solidusio/circleci-orbs-extensions#48, will be released in v0.4.0
@@ -82,8 +82,6 @@ module Spree::Api | |||
end | |||
|
|||
it "can update addresses and transition from address to delivery" do | |||
pending "SQLite adapter fails to provide a unique index" if ActiveRecord::Base.connection.adapter_name == "SQLite" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed with the Docker setup that the tests are green now 🍀
@@ -38,7 +38,7 @@ def self.setup(gem_root:, lib_name:, auto_migrate: true) | |||
ENV["LIB_NAME"] = lib_name | |||
DummyApp::Application.config.root = File.join(gem_root, 'spec', 'dummy') | |||
|
|||
DummyApp::Application.initialize! | |||
DummyApp::Application.initialize! unless DummyApp::Application.initialized? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
@@ -116,6 +116,7 @@ class Application < ::Rails::Application | |||
end | |||
config.paths['db/migrate'] = migration_dirs | |||
ActiveRecord::Migrator.migrations_paths = migration_dirs | |||
ActiveRecord::Migration.verbose = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @elia!
@forkata sure! I'll work that today 👍 |
While running specs locally I noticed that those two pending examples were successful.
Also restored another skipped commit.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed (
cross them outif they are not):I have attached screenshots to demo visual changes.I have opened a PR to update the guides.I have updated the readme to account for my changes.