Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta->schema validation warning #1211

Merged
merged 2 commits into from Jul 16, 2022
Merged

Conversation

ml-evs
Copy link
Member

@ml-evs ml-evs commented May 31, 2022

Closes #1209

request_str: str,
):
"""Tests that the endpoint responds with a `meta->schema`."""
if not response.json().get("meta", {}).get("schema"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worthwhile to test the schema field further? For example, by testing whether it is a valid url, and that there indeed is a schema at that url?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, there was some discussion that the meta->schema just needs to be a URI rather than a URL, I have just used URL here for the config name.

@ml-evs
Copy link
Member Author

ml-evs commented Jun 7, 2022

This is blocked by the other PR that introduces the relevant config, after which the tests here should pass.

@ml-evs ml-evs added validator Related to the OPTIMADE validator blocked For issues/PRs that are blocked by required changes/clarifications to the specification. and removed blocked For issues/PRs that are blocked by required changes/clarifications to the specification. labels Jun 9, 2022
@ml-evs ml-evs force-pushed the ml-evs/validate_meta_schema_field branch from 79f25e0 to 1dcf201 Compare June 11, 2022 11:10
@codecov
Copy link

codecov bot commented Jun 11, 2022

Codecov Report

Merging #1211 (db6dbcc) into master (96543fe) will increase coverage by 0.08%.
The diff coverage is 70.00%.

❗ Current head db6dbcc differs from pull request most recent head a951698. Consider uploading reports for the commit a951698 to get more accurate results

@@            Coverage Diff             @@
##           master    #1211      +/-   ##
==========================================
+ Coverage   91.23%   91.32%   +0.08%     
==========================================
  Files          72       72              
  Lines        4299     4309      +10     
==========================================
+ Hits         3922     3935      +13     
+ Misses        377      374       -3     
Flag Coverage Δ
project 91.32% <70.00%> (+0.08%) ⬆️
validator 90.57% <70.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
optimade/validator/validator.py 83.66% <70.00%> (-0.25%) ⬇️
optimade/client/client.py 81.01% <0.00%> (+2.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78163a7...a951698. Read the comment docs.

@JPBergsma JPBergsma self-requested a review July 4, 2022 18:31
JPBergsma
JPBergsma previously approved these changes Jul 4, 2022
Copy link
Contributor

@JPBergsma JPBergsma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ml-evs ml-evs force-pushed the ml-evs/validate_meta_schema_field branch from db6dbcc to a951698 Compare July 16, 2022 16:19
@ml-evs ml-evs merged commit 94704f9 into master Jul 16, 2022
@ml-evs ml-evs deleted the ml-evs/validate_meta_schema_field branch July 16, 2022 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validator Related to the OPTIMADE validator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The validator should check for meta->schema
2 participants