-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature: WP3 Process metadata validation #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some initial feedback
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
On a more general note, I see that this pattern is often used: assert (
expected_parameter["name"] == actual_parameter["name"]
), f"The parameter named '{actual_parameter['name']}' of the process \
'{expected_process.process_id}' should be named '{expected_parameter['name']}'" With pytest, I don't think you have to build such a message and you can replace these 4 lines with just 1: assert expected_parameter["name"] == actual_parameter["name"] pytest will automatically create a message describing the difference, and will do it smarter, less error prone and more flexible based on a verbosity level. For example: I had this failing test on a schema in load_collection. The manually constructed error message is this hard to read blob (I stripped some parts to keep it short here):
The automatic message from pytest (with increased verbosity through cli option
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left two comments for consideration.
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
… so short forms of urls are supported, remove superfluous code, remove message from all asserts, cleaned up getting actual process to only be a single line and be reused
a non-reusable generator was being cached instead of a cachable concrete result (list) related to PR #44
…difference and then checking removed or added parameters for default values.
…difference and then checking removed or added parameters for default values.
This should be ready for merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some more notes
src/openeo_test_suite/lib/internal-tests/test_process_registry.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
…fixture, warning to logger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some more notes
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
src/openeo_test_suite/tests/processes/metadata/test_process_metadata.py
Outdated
Show resolved
Hide resolved
…or links, links now sorted before comparing, changed the way additional or removed parameters are checked, removed todo from readme.md, documented L4 default
ok, many thanks for the quick updates, |
@GeraldIr I just noticed that your commits list an invalid email address, which probably ruins the proper attribution of your contributions in github and other tools:
I guess there is something wrong with your git setup |
@soxofaan thanks for noticing that, I just updated my global git config. Contributions are still correctly displayed as well. |
Add: functional and non-functional metadata tests to the openeo-test-suite as requested in #19
Functional metadata includes parameter types and return types.
Non-functional metadata includes descriptions, summaries and links.
Existence of the processes is naturally also checked.
To run these tests --openeo-backend-url has to be specified for the pytest command such that '/processes' or 'processes' can be added at the end in order to call the processes endpoint of the given backend (e.g.: "https://openeo-dev.eodc.eu/openeo/1.1.0")
This PR also adds a metadata field to the ProcessData class such that the existing infrastructure for process selection could be reused.
Example call:
pytest src/openeo_test_suite/tests/processes/metadata --html=reports/individual-processes.html --openeo-backend-url=https://openeo-dev.eodc.eu/openeo/1.1.0 --processes=pi