Skip to content

Commit

Permalink
Merge branch 'feature/ci-fixes' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Nov 6, 2023
2 parents 289c3cd + 48c9735 commit 7fb6663
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ 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 geoportal:ci --trace

- name: Artifacts - Upload coverage
uses: actions/upload-artifact@v2
Expand Down
20 changes: 6 additions & 14 deletions lib/tasks/geoportal.rake
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
# 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'
namespace :geoportal do
task :ci do
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
end

exit!(1) unless success
end

namespace :geoportal do
desc 'Run Solr and GeoBlacklight for interactive development'
task :server, [:rails_server_args] do
require 'solr_wrapper'
Expand Down

0 comments on commit 7fb6663

Please sign in to comment.