Skip to content

Commit

Permalink
Add Spec Run To CI (#200)
Browse files Browse the repository at this point in the history
* add delete job, track records without source ids without creating entries, properly show invalid records

* fixes for rubocop and feedback

* add rubocop to rake and specs to ci

* sqlite3

* rename

* make sure directory exist for spec runs

* make export dir for specs

* fix whitespace
  • Loading branch information
orangewolf authored Jun 8, 2020
1 parent 37b98fb commit 4557801
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rubocop.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rubocop
name: Lint
on:
pull_request:
branches:
Expand All @@ -8,7 +8,7 @@ on:
- master

jobs:
lint:
rubocop:
runs-on: ubuntu-latest

steps:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test
on:
pull_request:
branches:
- '**'
push:
branches:
- master

jobs:
rspec:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/cache@preview
id: cache
with:
path: ~/local/rubies
key: 2.6.5

- uses: clupprich/ruby-build-action@master
id: ruby
with:
ruby-version: 2.6.5
cache-available: ${{ steps.cache.outputs.cache-hit == 'true' }}

- name: Setup sqlite3
run: sudo apt-get install libsqlite3-dev

- name: Install dependencies
run: bundle install

- name: Migrate test database
run: bin/rails db:migrate RAILS_ENV=test

- name: Run rspec
run: rake
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ begin
rescue LoadError # rubocop:disable Lint/HandleExceptions
# no rspec available
end

require 'rubocop/rake_task'

RuboCop::RakeTask.new(:rubocop) do |t|
t.options = ['--display-cop-names']
end
1 change: 1 addition & 0 deletions spec/jobs/bulkrax/exporter_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Bulkrax
allow(Bulkrax::Exporter).to receive(:find).with(1).and_return(exporter)
allow(exporter).to receive(:exporter_runs).and_return([bulkrax_exporter_run])
allow(exporter).to receive(:mapping).and_return("title" => {})
exporter.setup_export_path
end

describe 'successful job', clean_downloads: true do
Expand Down
Empty file added tmp/exports/.gitkeep
Empty file.

0 comments on commit 4557801

Please sign in to comment.