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

Fix as type implementation #57

Merged
merged 12 commits into from
Feb 11, 2021

Conversation

CasperWA
Copy link
Member

@CasperWA CasperWA commented Feb 9, 2021

Closes #56.

If as type is supplied it is understood that the domain+path constitutes the complete URL to be tested.
Hence, only a single validation will be run, and the parameters all versioned paths and validate unversioned path have no meaning and will be ignored.
This means as type take precedence, which is what I would expect.

Possibly add:

  • Extend README with the internal precedence of parameters.

@CasperWA CasperWA requested a review from ml-evs February 9, 2021 12:50
@CasperWA
Copy link
Member Author

CasperWA commented Feb 9, 2021

It seems to me like there's an issue with the validator when using the --as-type parameter: CI running with verbosity 2.

Edit: Now also with verbosity 3 getting DEBUG messages as well.

@CasperWA
Copy link
Member Author

CasperWA commented Feb 9, 2021

It looks like the validator is running fine, but then either doesn't set valid to True or another issue presents itself. It also doesn't call print_summary() before returning, but I wouldn't think that that would matter?

@CasperWA
Copy link
Member Author

CasperWA commented Feb 9, 2021

Hmm, I tried it locally, and the return code is 0, so I'm not completely sure what's going on here.

This ensures the exit code is 0.

In Bash, if a negative check is done, and it's not true, the last
pipestatus is non-zero. In order to ensure a "correct" pipestatus and
scipt exit code, the else clause is added with a "pass" statement, in
the form of a colon (:).
This ensures the exit code is correctly set from the pipestatus.
@CasperWA
Copy link
Member Author

I found the reason for the action to exit with a non-zero code.
In Bash, if a negative check is done, and it's not true, the last pipestatus is non-zero. In order to ensure a "correct" pipestatus and
script exit code, an else clause can be added with a "pass" statement, in the form of a colon (:).

However, this created some issues with the exit code to be reported in entrypoint.sh. Instead, I have now moved the as type validator run to a later point, which should ensure the correct exit code is always reported, and there's no confusion concerning if/else tests affecting the exit code through pipestatus.

@CasperWA
Copy link
Member Author

CasperWA commented Feb 10, 2021

Note, currently I'm using a special branch of the optimade package for the as type CI test. Materials-Consortia/optimade-python-tools#700 needs to be merged and a new release should be made of the optimade package, before this PR can be merged.

@CasperWA
Copy link
Member Author

@ml-evs ready for review

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.

LGTM!

@CasperWA CasperWA merged commit adf1961 into Materials-Consortia:master Feb 11, 2021
@CasperWA CasperWA deleted the close_56_as-type-fix branch February 11, 2021 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

as_type seems to be used incorrectly
2 participants