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

Test Orders API tools parameters #825

Open
kevinlacaille opened this issue Dec 15, 2022 · 0 comments
Open

Test Orders API tools parameters #825

kevinlacaille opened this issue Dec 15, 2022 · 0 comments
Labels
better-testing Improving test coverage across the project orders api

Comments

@kevinlacaille
Copy link
Contributor

Expected behavior
When testing tools for the Orders API, I'd expect the tool name and the parameters to be validated.

Actual behavior (describe the problem)
When testing tools for the Orders API, only the tool name appears to be validated.

This seems to happen in the function _tool(). It looks like our tools get passed to _tool(), which validates the tool name, but not the tool’s parameters.

For instance, for harmonize_tool() could get passed any sort of target sensor name and the test won’t fail, because it’s only looking to see if the tool name, ‘harmonize’, is a valid tool, not if the parameter, sensor_name, is valid.

Related Issues
I created a ticket a month ago (#793), which sort of fixes this issue for harmonize_tool(), but doesn’t really do so.

Workaround
None.

Minimum, Complete, Viable Code Sample
Current solution in planet.specs:

def validate_tool(tool):
    return _validate_field(tool, SUPPORTED_TOOLS, 'tool')

Proposed solution in planet.specs:

def validate_tool_name(tool):
    return _validate_field(tool, SUPPORTED_TOOLS, 'tool')

def validate_tool_parameter(parameter):
    return _validate_field(parameter, SUPPORTED_PARAMS, 'parameter')

However, the issue here is that we'd be manually supplying SUPPORTED_PARAMS, which is it's own issue, because we need to continually manually check these against the openAPI spec.

@kevinlacaille kevinlacaille added bug better-testing Improving test coverage across the project orders api labels Dec 15, 2022
@kevinlacaille kevinlacaille added this to the 2.0b1: Core 'MVP' milestone Dec 15, 2022
@jreiberkyle jreiberkyle removed this from the 2.0b1: Core 'MVP' milestone Jan 18, 2023
@jreiberkyle jreiberkyle removed the bug label Mar 15, 2023
@jreiberkyle jreiberkyle added this to the V2 Post-Release milestone Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better-testing Improving test coverage across the project orders api
Projects
None yet
Development

No branches or pull requests

2 participants