Fix #454: Add end-to-end tests for the plugin-related SoftwareMetadata API#456
Fix #454: Add end-to-end tests for the plugin-related SoftwareMetadata API#456sdruskat wants to merge 65 commits intorefactor/423-implement-public-apifrom
SoftwareMetadata API#456Conversation
f45d9b4 to
9be8041
Compare
|
Re-opening after rebase on correct branch. |
| The full code and structure is available at [hermes-plugin-git](https://github.com/softwarepub/hermes-plugin-git). | ||
| This tutorial will present the basic steps for writing additional plugins. | ||
|
|
||
| The full code and structure of a harvest plugin is available at [hermes-plugin-git](https://github.com/softwarepub/hermes-plugin-git). |
There was a problem hiding this comment.
Made an Issue to update the plugin for later: softwarepub/hermes-plugin-git#3
| # That would be able to replace _search_license_info. | ||
| # FIXME: Some licenses in valid_licenses["hits"]["hits"]["props"]["url"] are only http although | ||
| # https://spdx.org/licenses/license.json lists them in crossRef as https | ||
|
|
There was a problem hiding this comment.
Yes that should be possible.
We should fix the licenses to https.
| if license_info is not None: | ||
| break | ||
| else: | ||
| # FIXME: Why is this only raised here and not always when license_info is None? |
There was a problem hiding this comment.
I think, it was originally because that was were the deposit step broke two years ago, when Zenodo implemented the need of the correct license identifier. But you are right, we should fix that.
|
|
||
| @pytest.fixture | ||
| def sandbox_auth(): | ||
| path = Path("./../auth.txt") |
There was a problem hiding this comment.
We need to tell users how to provide auth or skip the test for ci
There was a problem hiding this comment.
Especially for our testsuite ci
There was a problem hiding this comment.
Yes, implementing a way to provide auth seems reasonable.
(But the test is already skipped if the file doesn't exist.)
There was a problem hiding this comment.
It should now be possible to pass the auth token when running the tests.
To do this pass the custom command line option --sandbox_auth your_auth_token to the pytest command.
We will have to get a ZenodoSanbox account and auth token to put it into the GitHub secrets and then adapt the test workflow.
There was a problem hiding this comment.
Maybe also test for 3-way-merges. And test strategies in different files would be great.
|
Findings from user test (tested in poetry environment on command line):
deposit step:
|
|
Could you please provide more information on this error?
|
That is the only information provided for this error: |
|
Okay, I think I found the error and hopefully fixed it. Please let me know if the commit didn't fix it. |
|
Yes, this error is gone. Now I'm getting |
Ok so this error comes from invenio.py line 216: where license_url is in my case {"@id": "{license}"}, so this error triggers |
|
After giving the correct input (using license_url["@id]) it worked, but if your case has different input, we should find the source for this problem. |
|
According to schema the values for the license property are URLs or CreativeWork objects. |
|
Yeah but why is it passed like that, is the real question right. is it in the expanded.json from the curate step |
|
I don't know why this was (and still is) a requirement for the harvest and process steps. |
This information about the license being an ID is actually contained in the codemeta context: https://github.com/codemeta/codemeta/blob/13bb230d250775026691a102a24b97dea7669bf6/codemeta.jsonld#L44 |
|
Nice now it works:
|
No description provided.