This directory contains files and scripts to test various aspects of OnEarth. The included tests are:
test_colormap2vrt.py
-- testscolormap2vrt.py
test_colormap_html_sld.py
-- tests scripts for converting colormaps to HTML and SLDtest_gc_service.py
-- tests the OnEarth GetCapabilities Servicetest_generate_empty_tile.py
-- tests empty tile generation withoe_generate_empty_tile.py
test_legends.py
-- tests the oe_generate_legend tool with GIBS colormapstest_mapserver.py
-- tests wms requests via mapservertest_mod_mrf.py
-- tests the mod_mrf moduletest_mod_reproject.py
-- tests the mod_reproject moduletest_mod_twms.py
-- tests the mod_twms moduletest_mod_wmts_wrapper.py
-- tests the mod_wmts_wrapper moduletest_mrfgen.py
-- tests mrfgentest_sync_s3.py
-- testsoe_sync_s3_configs.py
andoe_sync_s3_idx.py
test_rgb_to_pal.py
-- tests RGB PNG to palette PNGtest_time_service.py
-- tests the OnEarth Time Servicetest_time_utils.py
-- tests time configuration utilitiestest_twmsbox_wmts_convert.py
-- tests ancillary WMTS/TWMS helper scripts (twmsbox2wmts.py
andwmts2twmsbox.py
)test_validate_palette.py
-- testsoe_validate_palette.py
test_vectorgen.py
-- tests vectorgen
There is a script called run_test_in_docker.sh that will run a test script
inside of a Docker container. It takes two parameters, the name of the onearth
Docker image to run the test in, and the name of the test script. After
running, the results will be written to a file in the src/test/results
directory.
Example:
./ci/run_test_in_docker.sh nasagibs/onearth-test:latest test_mod_mrf.py
Refer here for information on building the docker image used for testing.
These tests assume that OnEarth and its associated utilities are installed. Test files for mod_ tests must be copied to a directory that Apache has permission to access.*
The tests have additional dependencies from the rest of OnEarth. To install the Python dependencies required by the test scripts, run sudo pip3 install -r requirements.txt
.
Each test script will output a JUnit XML results file. By default, these files are named *_results.xml
. A different output filename can be specified with the -o
option, i.e. python3 test_mod_mrf.py -o output_file.xml
.
Note also that the mrfgen tests involve the downloading and processing of imagery, so they may take a while to complete. You may experience 'out of memory' errors if running these tests in a VM without enough memory configured.
- Tests that a request to timeservice without parameters will return all records
- Tests that a request to timeservice without parameters will return all records when there are records that use an unsorted set for the :periods key
- Test time snap for P1Y layer (year)
- Test time snap for P7D layer (week)
- Test time snap for P1M layer (month)
- Test time snap for PT2H layer (hour)
- Test time snap for PT6M layer (minute)
- Test time snap for PT6M layer (second)
- Test invalid layer error
- Test invalid date error
- Test out of range error for periods
- Test snap with single key parameter (key1)
- Test best layer to check filename, prefix, date
- Test snap with multiple key parameter (key1, key2, key3, etc)
- Test snapping to one of multiple periods
- Test snapping to one of multiple periods when an unsorted set is used for the :periods key
- Test requesting a static best layer
- Test the limit option to return the first n periods
- Test the limit option to return the last n periods
- Test the limit option to return the first n periods when n is larger than the number of periods
- Test the limit option to return the last n periods when n is larger than the number of periods
- Test the skip option to return periods after the first s periods
- Test that no periods are returned when the skip option is set to a number greater than the number of periods
- Test using the skip option together with a begin limit
- Test using the skip option together with a begin limit when an unsorted set is used for the :periods key
- Test using the skip option with an end limit to skip the last s periods
- Test using the skip and limit options to return the n periods after s when n is larger than the number of priods
- Test using the skip and limit options to return the last n periods after s when n is larger than the number of periods
- Test requesting periods between start and end dates
- Test requesting periods between start and end dates when the start and end dates fall on the start and end bounds of existing periods, respectively.
- Test requesting periods between start and end dates when there is a single period
- Test requesting periods when there is a single period spanning a single day and the requested start date occurs before that day.
- Test requesting periods after a start date
- Test requesting periods before an end date
- Test requesting periods when there are no periods that fall between the start and end date range
- Test requesting periods when there are no periods at all for a layer
- Test requesting periods between start and end dates when the start and end dates are within periods but do not correspond to dates that data would exist for, causing the start and end dates to be snapped to the next closest time within the periods
- Test requesting periods between subdaily start and end dates when the start and end dates are within subdaily periods but do not correspond to dates that data would exist for, causing the start and end dates to be snapped to the next closest time within the periods
- Test requesting periods between start and end dates when the start and end dates are not within any periods and there is an odd number of periods
- Test requesting periods between start and end dates when the start and end dates are not within any periods and there is an even number of periods
- Test requesting periods when the start and end dates fall within a period but there exists no valid dates between the start and end dates
- Test requesting periods for all layers between start and end dates
- Test requesting periods for all layers while using the limit option to return the first n periods
- Test requesting periods for all layers while using the limit option to return the last n periods
- Test requesting periods between start and end dates while using the limit option to return the first n periods
- Test requesting periods between start and end dates while using the limit option to return the last n periods
- Test a time snapping date request while specifying start and end dates
***There are currently two sets of tests endpoint agonostic and endpoint specific, endpoint specific are marked with _dep(deprecated) at the end. ***
- Time scrape S3 keys
- Time scrape S3 inventory
- Test period generation with single date
- Test period generation with subdaily
- Test period generation with multiday
- Test period generation with monthly
- Test period generation config DETECT everything
- Test period generation config DETECT/DETECT (start/end)
- Test period generation config DETECT/DETECT/P5D (start/end/forced-period)
- Test period generation config DETECT/P10D (all times/forced-period)
- Test period generation config 2017-01-01/2020-12-01/P8D (all forced)
- Test period generation config 2017-01-01/DETECT/PT1M (forced start/forced subdaily period)
- Test period generation config DETECT/2020-12-01/P1M (forced end/forced monthly period)
- Global geographic PNG-MRF
- Global input image
- Geographic projection
- Paletted PNG input image
- Paletted MRF-PNG output image
- Tiled polar north JPEG-MRF
- Tiled input images
- Stereographic Polar North projection
- JPEG input images
- MRF-JPEG output image
- Global web mercator JPEG-MRF
- Global input image in geographic projection
- Reprojection to web mercator
- Geographic PNG-MRF using granule input files
- Granule input images with global coverage
- Input images cross antimeridian
- Native geographic projection
- Generate initial empty MRF with nocopy option
- Insert into existing MRF
- Create MRF with single granule
- Create MRF composite image with multiple granules
- Blend input images
- Use z-levels
- Add image to new z-level
- Add image to existing z-level
- Add image to multiple z-levels
- Web Mercator PNG-MRF using granule input files
- Granule input images with partial coverage
- Reprojection to web mercator
- No blending of input images
- Automatic creation of empty MRF
- Tiled geographic JPEG-MRF using tiled input files with z-level and time
- Tiled input images
- RGBA TIFF input images
- Use single z-level
- Use time (hh:mm:ss)
- Use zdb lookup
- Large image
- Small image
- RGBAPal image
- RGB (No-Alpha) image with one missing color
- Small image with 1 missing color
- Small image with 101 missing color
- Small image with no matching colors
- Small image with mismatched transparency
- Small image with invalid fill value
- GeoTIFF image
- MVT MRF generation from single shapefile
- MVT MRF generation from single GeoJSON
- MVT MRF generation from single GeoJSON with polygon features
- MVT MRF generation from multiple shapefiles
- MVT MRF generation from multiple GeoJSON
- MVT MRF generation with specified overview levels
- MVT MRF generation with specified feature reduce rate
- MVT MRF generation with specified cluster reduce rate
- MVT MRF generation with feature filters
- MVT MRF generation with overview filters
- Shapefile generation from single GeoJSON
- Shapefile generation from single GeoJSON with polygon features
- Shapefile generation with differing
<target_epsg>
and<source_epsg>
- Cloud-optimized shapefile generation using
<cloud_optimized_shapefile>
- GeoJSON generation from single GeoJSON
- Shapefile generation from multiple GeoJSON using
<input_files>
(not in use: commented out) - Shapefile generation from multiple GeoJSON using
<input_dir>
(not in use: commented out) - Shapefile generation from multiple shapefiles (not in use: commented out)
- MVT MRF generation with differing
<target_epsg>
and<source_epsg>
(not in use: commented out)
Tests legends in horizontal and vertical formats as PNGs and SVGs using various GIBS colormaps. The list of colormaps are configured in this file.
- Downloading configs from an S3 bucket to an empty directory
- Downloading a config from an S3 bucket to a directory that already contains some of the S3 bucket's configs
- Deleting a config from a directory when the config isn't in the S3 bucket
- Downloading a config from S3 and deleting a config that isn't in the S3 bucket
- Performing a dry run of syncing configs using the
-n
(--dry-run
) argument - Overwriting configs that already exist in the directory using the
-f
(--force
) argument - Downloading IDX files from an S3 bucket to an empty directory
- Downloading IDX files from an S3 bucket to a directory that already contains some of the S3 bucket's IDX files
- Deleting IDX files from a directory that aren't found in the S3 bucket
- Downloading IDX files to a directory from S3 and deleting IDX files from the directory that aren't found in the S3 bucket
- Performing a dry run of syncing IDX files using the
-n
(--dry-run
) argument - Overwriting IDX files that already exist in the directory using the
-f
(--force
) argument - Overwriting IDX files whose checksums do not match those of corresponding files in S3 using the
-c
(--checksum
) argument - Deleting all configs from a directory when syncing with an empty S3 bucket (not in use: commented out)
- Deleting all IDX files from a directory when syncing with an empty S3 bucket (not in use: commented out)
- Converting from a Tiled WMS box to WMTS tile using
twmsbox2wmts.py
- Converting from a Tiled WMS box to WMTS tile using
twmsbox2wmts.py
with a specified--tilesize
- Converting from a WMTS tile to a Tiled WMS box using
wmts2twmsbox.py
with the--scale_denominator
option - Converting from a WMTS tile to a Tiled WMS box using
wmts2twmsbox.py
with the--scale_denominator
option and a specified--tilesize
- Converting from a WMTS tile to a Tiled WMS box using
wmts2twmsbox.py
with the--top_left_bbox
option - Using both scripts to convert from a Tiled WMS box to a WMTS tile and back to a Tiled WMS box, using the
--scale_denominator
option forwmts2twmsbox.py
- Using both scripts to convert from a Tiled WMS box to a WMTS tile and back to a Tiled WMS box, using the
--top_left_bbox
option forwmts2twmsbox.py
- Using both scripts to convert from a Tiled WMS box to a WMTS tile and back to a Tiled WMS box, using a specified
--tilesize
for each script and the--top_left_bbox
option forwmts2twmsbox.py
- Using both scripts to convert from a WMTS tile to a Tiled WMS box and back to a WMTS tile, using the
--scale_denominator
option forwmts2twmsbox.py
- Using both scripts to convert from a WMTS tile to a Tiled WMS box and back to a WMTS tile, using a specified
--tilesize
for each script and the--scale_denominator
option forwmts2twmsbox.py
- Using both scripts to convert from a WMTS tile to a Tiled WMS box and back to a WMTS tile, using the
--top_left_bbox
option forwmts2twmsbox.py
- Validating a colormap with a corresponding image that matches the colormap
- Validating a colormap with a corresponding image that matches the colormap using the
--no_index
option - Validating a colormap with a corresponding image that matches the colormap using the
--ignore_colors
option - Validating a colormap with a corresponding image that matches the colormap using the
--fill_value
option - Correctly failing to validate a colormap with a non-corresponding image that doesn't match the colormap
- Correctly failing to validate a colormap with a non-corresponding image that doesn't match the colormap using the
--no_index
option - Correctly failing to validate a colormap with a non-corresponding image that doesn't match the colormap using the
--ignore_colors
option - Correctly failing to validate a colormap with a non-corresponding image that doesn't match the colormap using the
--fill_value
option
- Merging a colormap with a VRT file to create a new VRT file.
- Merging a colormap with a VRT file using the
--transparent
option to create a new VRT file.
The following test cases for oe_generate_empty_tile.py
are defined in this file:
- Generating an empty tile from ColorMap_v1.2_Sample.xml
- Generating an empty tile from SampleColorMap_v1.2_ContinuousAndClass.xml
- Generating an empty tile using the
--height
and--width
options - Generating an empty tile using the
--width
option - Generating an empty tile using the
--type rgba
option
- Converting a colormap to HTML using
colorMaptoHTML_v1.0.py
- Converting a colormap to HTML using
colorMaptoHTML_v1.3.py
- Converting a colormap to a v1.0.0 SLD using
colorMaptoSLD.py
with-s 1.0.0
- Converting a colormap that has its "No Data" colormap listed first to a v1.1.0 SLD using
colorMaptoSLD.py
with-s 1.1.0
- Converting a colormap that has its "No Data" colormap listed last to a v1.1.0 SLD using
colorMaptoSLD.py
with-s 1.1.0
- Converting a v1.0.0 SLD to a colormap using
SLDtoColorMap.py
- Converting a v1.0.0 SLD to a colormap using
SLDtoColorMap.py
with the--offset
and--factor
options - Converting a v1.0.0 SLD to a colormap using
SLDtoColorMap.py
with the--precision
option - Converting a v1.1.0 SLD to a colormap using
SLDtoColorMap.py
- Converting a v1.1.0 SLD to a colormap using
SLDtoColorMap.py
with the--offset
and--factor
options - Converting a v1.1.0 SLD to a colormap using
SLDtoColorMap.py
with the--precision
option - Converting a v1.1.0 SLD to a colormap using
SLDtoColorMap.py
with the--densify
option withr
specified for "ramp"