Skip to content

Commit

Permalink
Merge pull request solidusio#4525 from nebulab/elia/test-sqlite
Browse files Browse the repository at this point in the history
Add a SQLite job to the CI
  • Loading branch information
kennyadsl authored Aug 25, 2022
2 parents 04e25d9 + e81727d commit 008192c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ executors:
- image: *image
- image: cimg/mysql:5.7

sqlite:
working_directory: *workdir
environment:
<<: *environment
DB: sqlite
docker:
- image: *image

commands:
setup:
steps:
Expand Down Expand Up @@ -139,6 +147,14 @@ jobs:
- setup
- test

sqlite:
executor: sqlite
parallelism: *parallelism
steps:
- setup
- libvips
- test

postgres_rails60:
executor: postgres
parallelism: *parallelism
Expand Down Expand Up @@ -168,6 +184,7 @@ workflows:
only: /master|v\d\.\d+/
- postgres
- mysql
- sqlite
- postgres_rails61
- postgres_rails60
- postgres_rails52
Expand Down
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ group :backend, :frontend, :core, :api do
end

group :backend, :frontend do
# 'net/http' is required by 'capybara/server', triggering
# a few "already initialized constant" warnings when loaded
# from default gems. See:
# - https://github.com/ruby/net-protocol/issues/10
# - https://stackoverflow.com/a/72474475
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3')
gem 'net-http', require: false
end

gem 'capybara', '~> 3.13', require: false
gem 'capybara-screenshot', '>= 1.0.18', require: false
gem 'selenium-webdriver', require: false
Expand Down
4 changes: 0 additions & 4 deletions api/spec/requests/spree/api/checkouts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

put spree.api_checkout_path(order),
params: { order_token: order.guest_token, order: {
bill_address_attributes: address,
Expand All @@ -109,8 +107,6 @@ module Spree::Api

# Regression test for https://github.com/spree/spree/issues/4498
it "does not contain duplicate variant data in delivery return" do
pending "SQLite adapter fails to provide a unique index" if ActiveRecord::Base.connection.adapter_name == "SQLite"

put spree.api_checkout_path(order),
params: { order_token: order.guest_token, order: {
bill_address_attributes: address,
Expand Down
7 changes: 4 additions & 3 deletions api/spec/requests/spree/api/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ module Spree::Api
expect(json_response['email']).to eq 'new@example.com'
end

# there's no validations on LegacyUser?
xit "cannot create a new user with invalid attributes" do
post spree.api_users_path, params: { user: {}, token: user.spree_api_key }
it "cannot create a new user with invalid attributes" do
allow_any_instance_of(Spree::LegacyUser).to receive(:save).and_return(false)

post spree.api_users_path, params: { user: { email: 'foo@example.com' }, token: user.spree_api_key }
expect(response.status).to eq(422)
expect(json_response["error"]).to eq("Invalid resource. Please fix errors and try again.")
end
Expand Down
3 changes: 2 additions & 1 deletion core/lib/spree/testing_support/dummy_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?

if auto_migrate
DummyApp::Migrations.auto_migrate
Expand Down Expand Up @@ -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

config.assets.paths << File.expand_path('dummy_app/assets/javascripts', __dir__)
config.assets.paths << File.expand_path('dummy_app/assets/stylesheets', __dir__)
Expand Down

0 comments on commit 008192c

Please sign in to comment.