-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from Open-EO/issue30-central-run-options
Centralize run options (and their docs) better
- Loading branch information
Showing
6 changed files
with
161 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pytest_plugins = [ | ||
"openeo_test_suite.lib.backend_under_test", | ||
"openeo_test_suite.lib.pytest_plugin", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import argparse | ||
|
||
import openeo | ||
|
||
from openeo_test_suite.lib.backend_under_test import ( | ||
HttpBackend, | ||
NoBackend, | ||
get_backend_url, | ||
set_backend_under_test, | ||
) | ||
|
||
|
||
def pytest_addoption(parser): | ||
"""Implementation of `pytest_addoption` hook.""" | ||
parser.addoption( | ||
"-U", | ||
"--openeo-backend-url", | ||
action="store", | ||
default=None, | ||
help="The openEO backend URL to connect to.", | ||
) | ||
|
||
parser.addoption( | ||
"--process-levels", | ||
action="store", | ||
default="", | ||
help="The openEO process profiles you want to test against, e.g. 'L1,L2,L2A'. Mutually exclusive with --processes.", | ||
) | ||
parser.addoption( | ||
"--processes", | ||
action="store", | ||
default="", | ||
help="The openEO processes you want to test against, e.g. 'apply,reduce_dimension'. Mutually exclusive with --process-levels.", | ||
) | ||
|
||
parser.addoption( | ||
"--experimental", | ||
type=bool, | ||
action=argparse.BooleanOptionalAction, | ||
default=False, | ||
help="Run tests for experimental functionality or not. By default the tests will be skipped.", | ||
) | ||
|
||
parser.addoption( | ||
"--runner", | ||
action="store", | ||
default="skip", | ||
help="A specific test runner to use for individual process tests. If not provided, uses a default HTTP API runner.", | ||
) | ||
|
||
parser.addoption( | ||
"--s2-collection", | ||
action="store", | ||
default=None, | ||
help="The data collection to test against. It can be either a Sentinel-2 STAC Collection or the name of an openEO Sentinel-2 Collection provided by the back-end.", | ||
) | ||
|
||
|
||
def pytest_configure(config): | ||
"""Implementation of `pytest_configure` hook.""" | ||
backend_url = get_backend_url(config) | ||
if backend_url is None: | ||
backend = NoBackend() | ||
else: | ||
connection = openeo.connect(url=backend_url, auto_validate=False) | ||
backend = HttpBackend(connection=connection) | ||
set_backend_under_test(backend) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters