hathitrust / hathifiles

Generation of Hathfiles
0 stars 0 forks source link

DEV-953: New report for items that change rights ic->pd #33

Closed mwarin closed 8 months ago

mwarin commented 8 months ago

What/why?

Kristina wants a way to get items that change from ic->pd. Aaron and I thought it could be done using HathiFiles, so that's why the report script is here.

Kristina described this to me as a (hopefully) somewhat temporary need. If it's still being used in 2025, then we have failed.

How?

The report script is written in bash, broken down into functions, and hopefully commented enough that it's readable and understandable.

Since we already have rspec in this repo, I wrote a ruby test to test the bash script, as awkward as that feels.

Files changed:

How to test

  1. Check out this repo, this branch.
  2. hathifiles$ bash bin/bash_session.sh
  3. /usr/src/app# bundle exec rspec spec/jobs/rights_change.rb
coveralls commented 8 months ago

Coverage Status

coverage: 96.558%. remained the same when pulling b3ee8b435137de9a8c1186b31d74bfd62639ad0d on DEV-953 into b412b4e549a579dc19dbd7ae11441648645da51b on main.

aelkiss commented 8 months ago

I wonder if since you have the bash script broken up into functions as well as something in 'spec/data' if it would be worth using bats https://github.com/bats-core/bats-core to test that you get what you expect?

mwarin commented 8 months ago

I wonder if since you have the bash script broken up into functions as well as something in 'spec/data' if it would be worth using bats https://github.com/bats-core/bats-core to test that you get what you expect?

The idea did strike me, but since we already are doing rspec and this is a pretty minor thing, can I just test it with rspec?

aelkiss commented 8 months ago

I wonder if since you have the bash script broken up into functions as well as something in 'spec/data' if it would be worth using bats https://github.com/bats-core/bats-core to test that you get what you expect?

The idea did strike me, but since we already are doing rspec and this is a pretty minor thing, can I just test it with rspec?

I missed that you were using rspec to test it, I think that's fine.