CADS E2E Tests
cads-e2e-tests --help
cads-e2e-tests --reports-path random_reports.jsonl
# requests.yaml
# Example 1: Document all available checks and settings
- collection_id: reanalysis-era5-single-levels
parameters:
# Optional parameters (random request if no parameters are provided)
variable: "2t"
product_type: "reanalysis"
date: "2012-12-01"
time: "12:00"
checks:
# Optional checks (remove any check to disable)
checksum: 01683b3d69dec4c7221e524e3f6697dd # file md5 hash
extension: .grib # file extension
size: 2076588 # file size in Bytes
# Checks that do not require downloading the results
time: 60 # maximum running time to generate results in seconds
content_length: 2076588 # file size in Bytes inferred from metadata
content_type: application/x-grib # file type inferred from metadata
settings:
# Optional request-specific settings
max_runtime: 60.0 # maximum time (in seconds) the request is allowed to run
randomise: false # pick one random value per parameter after intersecting the constraints (by default, only empty requests are randomised)
# Example 2: Failure
- collection_id: test-adaptor-dummy
parameters:
size: 0
checks:
size: 1 # wrong file size
# Example 3: Partial random request
- collection_id: reanalysis-era5-single-levels
parameters:
year: ["1990", "1991"]
settings:
randomise: true # random request for 1990 or 1991
cads-e2e-tests --requests-path requests.yaml --reports-path example_reports.jsonl
For best experience create a new conda environment (e.g. DEVELOP) with Python 3.11:
conda create -n DEVELOP -c conda-forge python=3.11
conda activate DEVELOP
Before pushing to GitHub, run the following commands:
- Update conda environment:
make conda-env-update
- Install this package:
pip install -e .
- Sync with the latest template (optional):
make template-update
- Run quality assurance checks:
make qa
- Run tests:
make unit-tests
- Run the static type checker:
make type-check
- Build the documentation (see Sphinx tutorial):
make docs-build
Copyright 2024, European Union.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.