git clone https://github.com/mlibrary/chipmunk
bundle install
bundle exec rspec
This repository includes a Docker container that has all of the dependencies of the integration tests pre-installed. You will need:
Then you can launch the container with docker-compose run web bash
, which gives you a shell
within that container with your current source code mounted. From there, you can install gems
and run the specs as normal (bundle install
and bin/rspec
, respectively).
rsync
and set up the ability for the current user to use rsync over
ssh to localhost
(an ssh key is nice but not required).git clone
/bundle install
as usualbundle exec rake keycard:migrate
bundle exec rake checkpoint:migrate
bundle exec rake db:setup
bundle exec rake chipmunk:setup
config/settings/development.local.yml
(see
example in development.yml
). For a simple test that doesn’t require any
pre-requisites, try using /bin/true
bundle exec rails server
bundle exec rake resque:pool
With chipmunk-client:
chipmunk-client
with the API key you got from bundle exec rake chipmunk:setup
bundle exec ruby -I lib bin/makebag audio 39015012345678 /path/to/audio/material /path/to/output/bag
bundle exec ruby -I lib bin/upload spec/support/fixtures/audio/upload/good
(or whatever bag you created before)curl -f -s -H "Authorization:Token token=YOUR_API_TOKEN" http://localhost:3000/v1/bags/EXTERNAL_ID | jq .
Which should result in something like:
{
"bag_id": "b2a07afc-800f-41c6-942d-91989aeed950",
"user": "someuser",
"content_type": "audio",
"external_id": "EXTERNAL_ID",
"upload_link": "localhost:/somewhere/chipmunk/incoming/b2a07afc-800f-41c6-942d-91989aeed950",
"storage_location": "/somewhere/chipmunk/repo/storage/b2/a0/7a/b2a07afc-800f-41c6-942d-91989aeed950",
"stored": true,
"created_at": "2018-03-26 18:56:58 UTC",
"updated_at": "2018-03-26 18:57:04 UTC"
}
Then you can verify the bag is properly stored in the listed storage_location
.
config/database.yml
config/secrets.yml
or via $SECRET_KEY_BASE
bundle exec rails server
)bundle exec rake resque:pool
)config/upload.yml
An external validator should accept as parameters:
The validator should return zero if the bag is valid and non-zero if the bag is not valid. Any output or errors will be captured for inspection by the client.