dior001/zenodo

Issues running specs

zdennis opened this issue · 0 comments

The spec suite seems to be finicky based on Zenodo API behavior which may have changed since this gem was authored, I'm not sure.

For example, deposition_actions_spec.rb#L40-L47 routinely fails because Zenodo has marked the deposition as being in the inprogress state. Trying to edit an inprogress Deposition results in a HTTP 400 Error. I'd link to the section on Zenodo's API but there is no way to link to that particular section). From Zenodo's API this means:

400 Bad Request: Deposition state does not allow for editing (e.g. depositions in state inprogress).

It seems that a Deposition that never gets a file and is never published will always be in the inprogress state. I don't know if this is for certain since it isn't documented, but it's what I've been seeing over the past few days. I have asked the question on Zenodo's Github issue 348.

Related, if you publish a Deposition with a file it will be moved to the done state. This means you should be able to run the "editing of a deposition" example at deposition_actions_spec.rb#L40-L47, and this works intermittently. Quite frequently the example will fail now with a HTTP 409 Conflict error from Zenodo which seems to be:

409 Conflict: Deposition is in the process of being integrated, please wait 5 minutes before trying again.

In order to have green spec suite it seems you need to remove the entire spec/fixtures/vcr_cassettes/ directory (or the specific cassette in question) and re-run the specs until you get lucky and they all pass.

I know this a bit tricky to protect against as this gem is an API wrapper for the Zenodo API and any oddities Zenodo itself has will have a cascading affect on tools that interface with it.