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 53 commits intorefactor/423-implement-public-apifrom
SoftwareMetadata API#456Conversation
f45d9b4 to
9be8041
Compare
|
Re-opening after rebase on correct branch. |
Merged implementation for curate step back into the feature branches base branch.
Merged features for process (new data model) back into the feature branches base branch.
Merged implementation for process and deposit step back into the feature branches base branch.
Merged implementation for postprocess step back into the feature branches base branch.
…e and changed the way commands handle errors in plugin runs
| 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.
| try: | ||
| cff = yaml.load(open('CITATION.cff', 'r'), yaml.Loader) | ||
| new_identifier = { | ||
| class cff_doi(HermesPostprocessPlugin): |
There was a problem hiding this comment.
Maybe also for codemeta, because we can not be sure the user has a cff
| "Or".join(types): MergeSet(match_multiple_types( | ||
| *(("schema:" + type, MATCH_FUNCTION_FOR_TYPE.get("schema:" + type, DEFAULT_MATCH)) for type in types) | ||
| )) | ||
| for types in [ |
There was a problem hiding this comment.
Maybe we can curl this information? Or automate the mapping?
But really good work 👍
There was a problem hiding this comment.
Maybe.
I'll think about whether or not this can be (easily) done.
Edit: It seems doable, I'll implement it in the next days.
|
|
||
| @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.)
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "metadata, invenio_metadata", |
There was a problem hiding this comment.
invenio_metada can change, maybe we should test the format as well?
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:
deposit step:
|
|
Could you please provide more information on this error?
|
| return None | ||
|
|
||
|
|
||
| class IvenioRDMDepositPlugin(InvenioDepositPlugin): |
There was a problem hiding this comment.
| class InvenioRDMDepositPlugin(InvenioDepositPlugin): |
| [project.entry-points."hermes.deposit"] | ||
| file = "hermes.commands.deposit.file:FileDepositPlugin" | ||
| invenio = "hermes.commands.deposit.invenio:InvenioDepositPlugin" | ||
| invenio_rdm = "hermes.commands.deposit.invenio_rdm:IvenioRDMDepositPlugin" |
There was a problem hiding this comment.
| invenio_rdm = "hermes.commands.deposit.invenio_rdm:InvenioRDMDepositPlugin" |
That is the only information provided for this error: |
No description provided.