Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change wording about schema-validation errors #680

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[2024-08-26T22:54:28] ERROR 1 UW schema-validation error found in config
[2024-08-26T22:54:28] ERROR 1 schema-validation error found in config
[2024-08-26T22:54:28] ERROR Error at values:
[2024-08-26T22:54:28] ERROR 'recipient' is a required property
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[2024-08-26T22:54:27] INFO 0 UW schema-validation errors found in config
[2024-08-26T22:54:27] INFO 0 schema-validation errors found in config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[2024-08-26T22:54:28] INFO 0 UW schema-validation errors found in config
[2024-08-26T22:54:28] INFO 0 schema-validation errors found in config
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
[2024-11-27T05:24:34] DEBUG values:
[2024-11-27T05:24:34] DEBUG greeting: Hello
[2024-11-27T05:24:34] DEBUG recipient: World
[2024-11-27T05:24:34] INFO 0 UW schema-validation errors found in config
[2024-11-27T05:24:34] INFO 0 schema-validation errors found in config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[2024-08-26T23:03:41] INFO 0 UW schema-validation errors found in rand config
[2024-08-26T23:03:41] INFO 0 schema-validation errors found in rand config
[2024-08-26T23:03:41] INFO rand Random-integer file: Initial state: Not Ready
[2024-08-26T23:03:41] INFO rand Random-integer file: Checking requirements
[2024-08-26T23:03:41] INFO rand Random-integer file: Requirement(s) ready
Expand Down
2 changes: 1 addition & 1 deletion docs/sections/user_guide/cli/tools/execute/execute.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[2024-08-26T23:03:40] INFO 0 UW schema-validation errors found in rand config
[2024-08-26T23:03:40] INFO 0 schema-validation errors found in rand config
[2024-08-26T23:03:40] INFO rand Random-integer file: Initial state: Not Ready
[2024-08-26T23:03:40] INFO rand Random-integer file: Checking requirements
[2024-08-26T23:03:40] INFO rand Random-integer file: Requirement(s) ready
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[2024-12-07T01:01:51] INFO Validating config against internal schema: files-to-stage
[2024-12-07T01:01:53] INFO 0 UW schema-validation errors found in fs config
[2024-12-07T01:01:53] INFO 0 schema-validation errors found in fs config
[2024-12-07T01:01:53] ERROR Relative path 'foo' requires target directory to be specified
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[2024-08-26T23:03:42] INFO Validating config against internal schema: files-to-stage
[2024-08-26T23:03:43] INFO 0 UW schema-validation errors found in fs config
[2024-08-26T23:03:43] INFO 0 schema-validation errors found in fs config
[2024-08-26T23:03:43] INFO File copies: Initial state: Not Ready
[2024-08-26T23:03:43] INFO File copies: Checking requirements
[2024-08-26T23:03:43] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Initial state: Not Ready
Expand Down
2 changes: 1 addition & 1 deletion docs/sections/user_guide/cli/tools/fs/copy-exec.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[2024-12-07T01:01:56] INFO Validating config against internal schema: files-to-stage
[2024-12-07T01:01:56] INFO 0 UW schema-validation errors found in fs config
[2024-12-07T01:01:56] INFO 0 schema-validation errors found in fs config
[2024-12-07T01:01:56] INFO File copies: Initial state: Not Ready
[2024-12-07T01:01:56] INFO File copies: Checking requirements
[2024-12-07T01:01:56] INFO Copy src/foo -> copy-dst/foo: Initial state: Not Ready
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[2024-12-07T01:01:55] INFO Validating config against internal schema: files-to-stage
[2024-12-07T01:01:55] INFO 0 UW schema-validation errors found in fs config
[2024-12-07T01:01:55] INFO 0 schema-validation errors found in fs config
[2024-12-07T01:01:55] ERROR Relative path 'foo' requires target directory to be specified
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[2024-08-26T23:03:41] INFO Validating config against internal schema: files-to-stage
[2024-08-26T23:03:41] INFO 0 UW schema-validation errors found in fs config
[2024-08-26T23:03:41] INFO 0 schema-validation errors found in fs config
[2024-08-26T23:03:41] INFO File links: Initial state: Not Ready
[2024-08-26T23:03:41] INFO File links: Checking requirements
[2024-08-26T23:03:41] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Initial state: Not Ready
Expand Down
2 changes: 1 addition & 1 deletion docs/sections/user_guide/cli/tools/fs/link-exec.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[2024-08-26T23:03:42] INFO Validating config against internal schema: files-to-stage
[2024-08-26T23:03:43] INFO 0 UW schema-validation errors found in fs config
[2024-08-26T23:03:43] INFO 0 schema-validation errors found in fs config
[2024-08-26T23:03:43] INFO File links: Initial state: Not Ready
[2024-08-26T23:03:43] INFO File links: Checking requirements
[2024-08-26T23:03:43] INFO Link link-dst/foo -> src/foo: Initial state: Not Ready
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[2024-12-07T01:01:55] INFO Validating config against internal schema: makedirs
[2024-12-07T01:01:55] INFO 0 UW schema-validation errors found in fs config
[2024-12-07T01:01:55] INFO 0 schema-validation errors found in fs config
[2024-12-07T01:01:55] ERROR Relative path 'foo' requires target directory to be specified
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[2024-08-26T23:03:46] INFO Validating config against internal schema: makedirs
[2024-08-26T23:03:46] INFO 0 UW schema-validation errors found in fs config
[2024-08-26T23:03:46] INFO 0 schema-validation errors found in fs config
[2024-08-26T23:03:46] INFO Directories: Initial state: Not Ready
[2024-08-26T23:03:46] INFO Directories: Checking requirements
[2024-08-26T23:03:46] INFO Directory makedirs-parent-timedep/foo/20240529/12/006/bar: Initial state: Not Ready
Expand Down
2 changes: 1 addition & 1 deletion docs/sections/user_guide/cli/tools/fs/makedirs-exec.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[2024-08-26T23:03:46] INFO Validating config against internal schema: makedirs
[2024-08-26T23:03:46] INFO 0 UW schema-validation errors found in fs config
[2024-08-26T23:03:46] INFO 0 schema-validation errors found in fs config
[2024-08-26T23:03:46] INFO Directories: Initial state: Not Ready
[2024-08-26T23:03:46] INFO Directories: Checking requirements
[2024-08-26T23:03:46] INFO Directory makedirs-parent/foo: Initial state: Not Ready
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[2024-08-26T23:11:41] INFO 0 UW schema-validation errors found in Rocoto config
[2024-08-26T23:11:41] INFO 0 schema-validation errors found in Rocoto config
[2024-08-26T23:11:41] INFO 0 Rocoto XML validation errors found

<?xml version='1.0' encoding='utf-8'?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[2024-08-26T23:11:42] INFO 0 UW schema-validation errors found in Rocoto config
[2024-08-26T23:11:42] INFO 0 schema-validation errors found in Rocoto config
[2024-08-26T23:11:42] INFO 0 Rocoto XML validation errors found
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE workflow [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[2024-08-26T23:11:42] INFO 0 UW schema-validation errors found in Rocoto config
[2024-08-26T23:11:42] INFO 0 schema-validation errors found in Rocoto config
[2024-08-26T23:11:42] INFO 0 Rocoto XML validation errors found
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE workflow [
Expand Down
4 changes: 2 additions & 2 deletions notebooks/config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"[2024-11-19T23:12:53] INFO 0 UW schema-validation errors found in config\n"
"[2024-11-19T23:12:53] INFO 0 schema-validation errors found in config\n"
]
},
{
Expand Down Expand Up @@ -1376,7 +1376,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"[2024-11-19T23:12:53] ERROR 1 UW schema-validation error found in config\n",
"[2024-11-19T23:12:53] ERROR 1 schema-validation error found in config\n",
"[2024-11-19T23:12:53] ERROR Error at recipient:\n",
"[2024-11-19T23:12:53] ERROR 47 is not of type 'string'\n"
]
Expand Down
4 changes: 2 additions & 2 deletions notebooks/exp-config-cb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@
"output_type": "stream",
"text": [
"[2024-11-19T23:14:15] INFO Validating config against internal schema: chgres-cube\n",
"[2024-11-19T23:14:15] INFO 0 UW schema-validation errors found in chgres_cube config\n",
"[2024-11-19T23:14:15] INFO 0 schema-validation errors found in chgres_cube config\n",
"[2024-11-19T23:14:15] INFO Validating config against internal schema: platform\n",
"[2024-11-19T23:14:15] INFO 0 UW schema-validation errors found in platform config\n",
"[2024-11-19T23:14:15] INFO 0 schema-validation errors found in platform config\n",
"[2024-11-19T23:14:15] INFO 20241120 05:14:15 chgres_cube valid schema: State: Ready\n"
]
},
Expand Down
22 changes: 11 additions & 11 deletions notebooks/fs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:56:27] INFO Validating config against internal schema: files-to-stage\n",
"[2024-12-09T21:56:27] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:56:27] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:56:27] INFO File copies: Initial state: Not Ready\n",
"[2024-12-09T21:56:27] INFO File copies: Checking requirements\n",
"[2024-12-09T21:56:27] INFO Copy fixtures/fs/file1.nml -> tmp/copy-target/file1-copy.nml: Initial state: Not Ready\n",
Expand Down Expand Up @@ -225,7 +225,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:56:33] INFO Validating config against internal schema: files-to-stage\n",
"[2024-12-09T21:56:33] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:56:33] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:56:33] INFO File copies: Initial state: Not Ready\n",
"[2024-12-09T21:56:33] INFO File copies: Checking requirements\n",
"[2024-12-09T21:56:33] INFO Copy fixtures/fs/missing-file.nml -> tmp/copy-target/missing-copy.nml: Initial state: Not Ready\n",
Expand Down Expand Up @@ -340,7 +340,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:57:25] INFO Validating config against internal schema: files-to-stage\n",
"[2024-12-09T21:57:25] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:57:25] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:57:25] INFO File copies: Initial state: Not Ready\n",
"[2024-12-09T21:57:25] INFO File copies: Checking requirements\n",
"[2024-12-09T21:57:25] INFO Copy fixtures/fs/file1.nml -> tmp/copy-keys-target/file1-copy.nml: Initial state: Not Ready\n",
Expand Down Expand Up @@ -507,7 +507,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:57:38] INFO Validating config against internal schema: files-to-stage\n",
"[2024-12-09T21:57:38] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:57:38] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:57:38] INFO File copies: Initial state: Not Ready\n",
"[2024-12-09T21:57:38] INFO File copies: Checking requirements\n",
"[2024-12-09T21:57:38] INFO Copy fixtures/fs/file1.nml -> tmp/copier-target/file1-copy.nml: Initial state: Not Ready\n",
Expand Down Expand Up @@ -672,7 +672,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:57:45] INFO Validating config against internal schema: files-to-stage\n",
"[2024-12-09T21:57:45] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:57:45] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:57:45] INFO File links: Initial state: Not Ready\n",
"[2024-12-09T21:57:45] INFO File links: Checking requirements\n",
"[2024-12-09T21:57:45] INFO Link tmp/link-target/file1-link.nml -> fixtures/fs/file1.nml: Initial state: Not Ready\n",
Expand Down Expand Up @@ -766,7 +766,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:57:49] INFO Validating config against internal schema: files-to-stage\n",
"[2024-12-09T21:57:49] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:57:49] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:57:49] INFO File links: Initial state: Not Ready\n",
"[2024-12-09T21:57:49] INFO File links: Checking requirements\n",
"[2024-12-09T21:57:49] INFO Link tmp/link-target/missing-link.nml -> fixtures/fs/missing-file.nml: Initial state: Not Ready\n",
Expand Down Expand Up @@ -881,7 +881,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:58:19] INFO Validating config against internal schema: files-to-stage\n",
"[2024-12-09T21:58:19] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:58:19] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:58:19] INFO File links: Initial state: Not Ready\n",
"[2024-12-09T21:58:19] INFO File links: Checking requirements\n",
"[2024-12-09T21:58:19] INFO Link tmp/link-keys-target/file1-link.nml -> fixtures/fs/file1.nml: Initial state: Not Ready\n",
Expand Down Expand Up @@ -1048,7 +1048,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:58:29] INFO Validating config against internal schema: files-to-stage\n",
"[2024-12-09T21:58:29] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:58:29] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:58:29] INFO File links: Initial state: Not Ready\n",
"[2024-12-09T21:58:29] INFO File links: Checking requirements\n",
"[2024-12-09T21:58:29] INFO Link tmp/linker-target/file1-link.nml -> fixtures/fs/file1.nml: Initial state: Not Ready\n",
Expand Down Expand Up @@ -1213,7 +1213,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:58:35] INFO Validating config against internal schema: makedirs\n",
"[2024-12-09T21:58:35] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:58:35] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:58:35] INFO Directories: Initial state: Not Ready\n",
"[2024-12-09T21:58:35] INFO Directories: Checking requirements\n",
"[2024-12-09T21:58:35] INFO Directory tmp/dir-target/foo: Initial state: Not Ready\n",
Expand Down Expand Up @@ -1333,7 +1333,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:59:02] INFO Validating config against internal schema: makedirs\n",
"[2024-12-09T21:59:02] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:59:02] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:59:02] INFO Directories: Initial state: Not Ready\n",
"[2024-12-09T21:59:02] INFO Directories: Checking requirements\n",
"[2024-12-09T21:59:02] INFO Directory tmp/dir-keys-target/foo/bar: Initial state: Not Ready\n",
Expand Down Expand Up @@ -1493,7 +1493,7 @@
"output_type": "stream",
"text": [
"[2024-12-09T21:59:07] INFO Validating config against internal schema: makedirs\n",
"[2024-12-09T21:59:07] INFO 0 UW schema-validation errors found in fs config\n",
"[2024-12-09T21:59:07] INFO 0 schema-validation errors found in fs config\n",
"[2024-12-09T21:59:07] INFO Directories: Initial state: Not Ready\n",
"[2024-12-09T21:59:07] INFO Directories: Checking requirements\n",
"[2024-12-09T21:59:07] INFO Directory tmp/makedirs-target/foo: Initial state: Not Ready\n",
Expand Down
10 changes: 5 additions & 5 deletions notebooks/rocoto.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"[2024-11-19T23:15:43] INFO 0 UW schema-validation errors found in Rocoto config\n",
"[2024-11-19T23:15:43] INFO 0 schema-validation errors found in Rocoto config\n",
"[2024-11-19T23:15:43] INFO 0 Rocoto XML validation errors found\n"
]
},
Expand Down Expand Up @@ -256,7 +256,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"[2024-11-19T23:15:43] ERROR 3 UW schema-validation errors found in Rocoto config\n",
"[2024-11-19T23:15:43] ERROR 3 schema-validation errors found in Rocoto config\n",
"[2024-11-19T23:15:43] ERROR Error at workflow -> attrs:\n",
"[2024-11-19T23:15:43] ERROR 'realtime' is a required property\n",
"[2024-11-19T23:15:43] ERROR Error at workflow -> tasks -> task_greet:\n",
Expand Down Expand Up @@ -388,7 +388,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"[2024-11-19T23:15:43] INFO 0 UW schema-validation errors found in Rocoto config\n",
"[2024-11-19T23:15:43] INFO 0 schema-validation errors found in Rocoto config\n",
"[2024-11-19T23:15:43] INFO 0 Rocoto XML validation errors found\n"
]
},
Expand Down Expand Up @@ -577,7 +577,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"[2024-11-19T23:15:43] INFO 0 UW schema-validation errors found in Rocoto config\n",
"[2024-11-19T23:15:43] INFO 0 schema-validation errors found in Rocoto config\n",
"[2024-11-19T23:15:43] INFO 0 Rocoto XML validation errors found\n"
]
},
Expand Down Expand Up @@ -722,7 +722,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"[2024-11-19T23:15:43] INFO 0 UW schema-validation errors found in Rocoto config\n",
"[2024-11-19T23:15:43] INFO 0 schema-validation errors found in Rocoto config\n",
"[2024-11-19T23:15:43] INFO 0 Rocoto XML validation errors found\n"
]
},
Expand Down
4 changes: 2 additions & 2 deletions notebooks/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def test_validate():
with testbook("config.ipynb", execute=True) as tb:
assert tb.cell_output_text(69) == cfg
assert tb.cell_output_text(71) == schema
valid_out = ("INFO 0 UW schema-validation errors found", "True")
valid_out = ("INFO 0 schema-validation errors found", "True")
assert all(x in tb.cell_output_text(73) for x in valid_out)
invalid_out = (
"ERROR 1 UW schema-validation error found",
"ERROR 1 schema-validation error found",
"ERROR 47 is not of type 'string'",
"False",
)
Expand Down
2 changes: 1 addition & 1 deletion notebooks/tests/test_exp_config_cb.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_exp_config():
assert all(x in tb.cell_output_text(13) for x in deref_cfg)
validate_out = (
"INFO Validating config against internal schema: chgres-cube",
"INFO 0 UW schema-validation errors found",
"INFO 0 schema-validation errors found",
"INFO Validating config against internal schema: platform",
"chgres_cube valid schema: State: Ready",
)
Expand Down
6 changes: 3 additions & 3 deletions notebooks/tests/test_rocoto.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def test_building_simple_workflow():
simple_xml = f.read().rstrip()
assert tb.cell_output_text(5) == simple_yaml
valid_out = (
"INFO 0 UW schema-validation errors found",
"INFO 0 schema-validation errors found",
"INFO 0 Rocoto XML validation errors found",
"True",
)
assert all(x in tb.cell_output_text(7) for x in valid_out)
assert tb.cell_output_text(9) == simple_xml
assert tb.cell_output_text(11) == err_yaml
err_out = (
"ERROR 3 UW schema-validation errors found",
"ERROR 3 schema-validation errors found",
"ERROR Error at workflow.attrs:",
"ERROR 'realtime' is a required property",
"ERROR Error at workflow.tasks.task_greet:",
Expand Down Expand Up @@ -54,7 +54,7 @@ def test_building_workflows():
assert tb.cell_output_text(15) == ent_yaml
assert tb.cell_output_text(17) == ent_cs_yaml
valid_out = (
"INFO 0 UW schema-validation errors found",
"INFO 0 schema-validation errors found",
"INFO 0 Rocoto XML validation errors found",
"True",
)
Expand Down
2 changes: 1 addition & 1 deletion src/uwtools/config/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def validate(schema: dict, desc: str, config: dict) -> bool:
"""
errors = _validation_errors(config, schema)
log_method = log.error if errors else log.info
log_msg = "%s UW schema-validation error%s found in %s"
log_msg = "%s schema-validation error%s found in %s"
log_method(log_msg, len(errors), "" if len(errors) == 1 else "s", desc)
for error in errors:
log.error("Error at %s:", ".".join(str(k) for k in error.path))
Expand Down
Loading
Loading