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

Run testsuite also with sqlite #1110

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/lint-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ jobs:
run: |
bundle exec rspec --format documentation

- name: Run core tests with sqlite
run: |
sed -i 's/adapter: mysql2/adapter: sqlite3/' config/rmt.yml
bundle exec rspec --format documentation

- name: Run PubCloud engines tests
run: |
bundle exec rake test:engines
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/rmt/cli/smt_importer_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'rails_helper'
require 'rmt/cli/smt_importer'

describe RMT::CLI::SMTImporter do
describe RMT::CLI::SMTImporter, :skip_sqlite do
let(:data_dir) { File.join(Dir.pwd, 'spec/fixtures/files/csv') }
let(:no_systems) { false }
let(:importer) { described_class.new(data_dir, no_systems) }
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/rmt/lockfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RSpec.describe RMT::Lockfile do
let(:lock_name) { nil }

describe '#lock' do
describe '#lock', :skip_sqlite do
subject(:lock) { described_class.lock(lock_name) { nil } }

context 'with an unnamed lock' do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/rmt/scc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
described_class.new.sync
end

it 'removes existing predecessor associations' do
it 'removes existing predecessor associations', :skip_sqlite do
expect { ProductPredecessorAssociation.find(existing_association.id) }.to raise_error(ActiveRecord::RecordNotFound)
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/models/repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
expect(friendly_id).to eq('my-repo-100000')
end

it 'appends with unicode within the chain' do
it 'appends with unicode within the chain', :skip_sqlite do
create(:repository, friendly_id: 'my-repo')
create(:repository, friendly_id: 'my-repö-1')
expect(friendly_id).to eq('my-repo-2')
Expand All @@ -165,13 +165,13 @@
expect(friendly_id).to eq('dümmy-repö')
end

it 'appends with unicode within the chain' do
it 'appends with unicode within the chain', :skip_sqlite do
create(:repository, friendly_id: 'dummy-repo')
create(:repository, friendly_id: 'dümmy-repö-1')
expect(friendly_id).to eq('dümmy-repö-2')
end

it 'correctly appends' do
it 'correctly appends', :skip_sqlite do
create(:repository, friendly_id: 'dummy-repo')
create(:repository, friendly_id: 'dummy-repo-1')
expect(friendly_id).to eq('dümmy-repö-2')
Expand Down
6 changes: 6 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
config.filter_rails_from_backtrace!
# arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name")

# Skipping some tests when running with (experimental) sqlite backend.
# Some tests / code parts are using specific mysql behavior
if ActiveRecord::Base.connection.adapter_name == 'SQLite'
config.filter_run_excluding skip_sqlite: true
end
end

Shoulda::Matchers.configure do |config|
Expand Down
2 changes: 1 addition & 1 deletion spec/services/repository_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

it('is not custom') { expect(repository.custom?).to eq(true) }

context 'already existing repositories with changing URL' do
context 'already existing repositories with changing URL', :skip_sqlite do
subject(:repository) do
service.create_repository!(product, url, attributes, custom: custom).reload
url = 'https://foo.bar.com/bar/foo'
Expand Down