diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b58374f63..accfaa081 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,12 +69,14 @@ jobs: bin/rails db:migrate RAILS_ENV=test - name: Rails - Run tests - run: bundle exec rake ci env: + RAILS_ENV: test rails_version: 6.1.5 ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test' SOLR_URL: http://solr:SolrRocks@localhost:8983/solr/blacklight-core FARADAY_VERSION: ${{ matrix.faraday_version }} + run: bundle exec rake ci + - name: Artifacts - Upload coverage uses: actions/upload-artifact@v2 diff --git a/lib/tasks/geoportal.rake b/lib/tasks/geoportal.rake index 9929e7c67..03a9484d9 100644 --- a/lib/tasks/geoportal.rake +++ b/lib/tasks/geoportal.rake @@ -1,19 +1,12 @@ # frozen_string_literal: true -desc 'Run test suite' task :ci do - shared_solr_opts = { managed: true, verbose: true, persist: false, download_dir: 'tmp' } - shared_solr_opts[:version] = ENV['SOLR_VERSION'] if ENV['SOLR_VERSION'] - - success = true - SolrWrapper.wrap(shared_solr_opts.merge(port: 8985, instance_dir: 'tmp/geoportal-core-test')) do |solr| - solr.with_collection(name: "geoportal-core-test", dir: Rails.root.join("solr", "conf").to_s) do - system 'RAILS_ENV=test bundle exec rake geoportal:index:seed' - system('RAILS_ENV=test bundle exec rails test:system test') || success = false - end + if Rails.env.test? + success = true + Rake::Task['geoportal:index:seed'].invoke + system('RAILS_ENV=test bundle exec rails test:system test') || success = false + exit!(1) unless success end - - exit!(1) unless success end namespace :geoportal do