Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
Add option to limit validation to specific dataset(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
copierrj committed Oct 19, 2021
1 parent 603d546 commit ea880e5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
9 changes: 8 additions & 1 deletion linkage_checker/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ def cli():
default=False,
help="Enables debug mode which will run tests for the first three NGR records.",
)
@click.option(
"--uuid",
required=False,
multiple=True,
help="Specify uuid of datasets to validate."
)
@click_log.simple_verbosity_option(logger)
def linkage_checker_command(
output_path, remote_selenium_url, enable_caching, browser_screenshots, debug_mode
output_path, remote_selenium_url, enable_caching, browser_screenshots, debug_mode, uuid
):
set_log_level()

Expand All @@ -81,6 +87,7 @@ def linkage_checker_command(
enable_caching,
browser_screenshots,
debug_mode,
uuid,
)
except AppError:
logger.exception("linkage-checker failed:")
Expand Down
22 changes: 21 additions & 1 deletion linkage_checker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@


def main(
output_path, remote_selenium_url, enable_caching, browser_screenshots, debug_mode
output_path, remote_selenium_url, enable_caching, browser_screenshots, debug_mode, uuid
):
logger.info("output path = " + str(output_path))
logger.info("remote_selenium_url = " + str(remote_selenium_url))
logger.info("caching enabled = " + str(enable_caching))
logger.info("make browser screenshots = " + str(browser_screenshots))
logger.info("debug_mode = " + str(debug_mode))
if uuid:
logger.info("uuid = " + ', '.join(uuid))
else:
logger.info("uuid = None")

start_time = datetime.now()

Expand All @@ -39,8 +43,24 @@ def main(

logger.info("number of ngr records found: %d", number_off_ngr_records)

if uuid:
only_uuids = set(uuid)
else:
only_uuids = None

for index in range(number_off_ngr_records):
ngr_record = all_ngr_records[index]

if only_uuids and not ngr_record["uuid"] in only_uuids:
logger.info(
"%s/%s skipping dataset %s (%s)",
index + 1,
number_off_ngr_records,
ngr_record["title"],
ngr_record["uuid"]
)
continue

logger.info(
"%s/%s validating dataset %s (%s)",
index + 1,
Expand Down

0 comments on commit ea880e5

Please sign in to comment.