From f64d81234dfb4765dac429ff108fca7ccb72cbf2 Mon Sep 17 00:00:00 2001 From: Ciheim Brown Date: Thu, 19 Dec 2024 15:00:42 -0500 Subject: [PATCH] Adding instructions for test_catalog.py script --- catalogbuilder/scripts/test_catalog.py | 7 +++++++ doc/generation.rst | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/catalogbuilder/scripts/test_catalog.py b/catalogbuilder/scripts/test_catalog.py index ed44d95..516c932 100755 --- a/catalogbuilder/scripts/test_catalog.py +++ b/catalogbuilder/scripts/test_catalog.py @@ -14,6 +14,13 @@ def main(json_path,json_template_path,test_failure): """ This test ensures catalogs generated by the Catalog Builder tool are minimally valid. This means a few things: the generated catalog JSON file reflects the template it was generated with, the catalog CSV has atleast one row of values (not headers), and each required column exists without any empty values. If a test case is broken or expected to fail, the --test-failure/-tf flag can be used. This flag will simply print errors instead of doing a sys.exit. + + USAGE: + + test_catalog.py - Checks catalog for consistency with default template + or + test_catalog.py - Checks catalog for consistency with custom template + JSON_PATH: Path to generated schema to be tested JSON_TEMPLATE_PATH: Path of schema template. Without a given path, cats/gfdl_template.json will be used for comparison """ diff --git a/doc/generation.rst b/doc/generation.rst index c91d29c..f0b38c1 100644 --- a/doc/generation.rst +++ b/doc/generation.rst @@ -252,3 +252,19 @@ Ex. gen_intake_gfdl.py /archive/Some.User/input-path ./output_path - --slow - Activates slow mode which retrieves standard_name (or long_name) where possible. **"Standard_name" must be in your output_path_template** - --i - Optional method for passing input path - --o - Optional method for passing output path + +Validating Generated Catalogs +_____________________________ + +This test ensures catalogs generated by the Catalog Builder tool are minimally valid. This means a few things: the generated catalog JSON file reflects the template it was generated with, the catalog CSV has atleast one row of values (not headers), and each required column exists without any empty values. If a test case is broken or expected to fail, the --test-failure/-tf flag can be used. This flag will simply print errors instead of doing a sys.exit. + + + USAGE: + + test_catalog.py - Checks catalog for consistency with default template + or + test_catalog.py - Checks catalog for consistency with custom template + + JSON_PATH: Path to generated schema to be tested + + JSON_TEMPLATE_PATH: Path of schema template. Without a given path, cats/gfdl_template.json will be used for comparison