Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

using ingest to seed the tests #1628

Open
pgwillia opened this issue May 3, 2019 · 0 comments
Open

using ingest to seed the tests #1628

pgwillia opened this issue May 3, 2019 · 0 comments

Comments

@pgwillia
Copy link
Member

pgwillia commented May 3, 2019

Describe the bug
Using ingest to seed the tests

  • slows down the tests
  • pollutes the logs on travis
  • seeds many items that are unused by the tests

To Reproduce
bundle exec rake spec

# smoke test the ingest task and setup some seed data for testing
require 'rake'
Rails.application.load_tasks
Rake::Task['delete'].invoke
%w[database_test_set sfx_test_set symphony_test_set].each do |test_set|
# work around tasks already_invoked flag being set
Rake::Task['ingest'].reenable
Rake::Task['solr:marc:index'].reenable
Rake::Task['solr:marc:index:work'].reenable
Rake::Task['ingest'].invoke(test_set)
end

Expected behavior
Seed only what is required to test. Use initializer specific to the test at hand. Keep the tests really fast to run.

Additional context
Maybe move the smoke test to a travis script? There is also a tangle in blacklight_helper.rb, spec_helper.rb and rails_helper.rb to require code that could be cleaner and more selective.

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

No branches or pull requests

1 participant