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

Bugfix validator so next links are followed the correct number of times #1318

Conversation

JPBergsma
Copy link
Contributor

@JPBergsma JPBergsma commented Sep 1, 2022

This PR corrects a bug in the validator which caused the next links to be followed at most two times.
I also removed the unused multistage argument.

Because I updated my dependencies, there is also a change in the openapi specs.

…ink times instaed of a maximum of two times.
Comment on lines 1341 to 1345
check_next_link = check_next_link - 1
self._test_page_limit(
next_response,
check_next_link=check_next_link,
multistage=check_next_link,
previous_links=previous_links,
Copy link
Member

Choose a reason for hiding this comment

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

Multistage is used in the decorated function (@test_case) to prevent validator returning an error for each individual step of a recursive function, so I would leave that in.

Copy link
Member

Choose a reason for hiding this comment

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

I'll also investigate a little why this is causing test failures just for the docker image atm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have processed your remarks and I think it should be good to merge now.

@codecov
Copy link

codecov bot commented Sep 1, 2022

Codecov Report

Merging #1318 (cf527a0) into master (fdb948d) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1318   +/-   ##
=======================================
  Coverage   90.90%   90.90%           
=======================================
  Files          72       72           
  Lines        4364     4364           
=======================================
  Hits         3967     3967           
  Misses        397      397           
Flag Coverage Δ
project 90.90% <100.00%> (ø)
validator 90.90% <100.00%> (ø)

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

Impacted Files Coverage Δ
optimade/validator/validator.py 83.54% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

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

Thanks @JPBergsma!

@ml-evs ml-evs merged commit c43fbce into Materials-Consortia:master Sep 1, 2022
@ml-evs ml-evs added bug Something isn't working validator Related to the OPTIMADE validator labels Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validator Related to the OPTIMADE validator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants