Skip to content

Commit

Permalink
Test Concurrency (ufs-community#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
maddenp-noaa authored Jun 5, 2024
1 parent 9f272a9 commit 737675c
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 83 deletions.
20 changes: 10 additions & 10 deletions docs/sections/user_guide/cli/tools/file/copy-exec-timedep.out
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[2024-05-29T16:50:14] INFO Validating config against internal schema files-to-stage
[2024-05-29T16:50:14] INFO 0 UW schema-validation errors found
[2024-05-29T16:50:14] INFO File copies: Initial state: Pending
[2024-05-29T16:50:14] INFO File copies: Checking requirements
[2024-05-29T16:50:14] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Initial state: Pending
[2024-05-29T16:50:14] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Checking requirements
[2024-05-29T16:50:14] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Requirement(s) ready
[2024-05-29T16:50:14] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Executing
[2024-05-29T16:50:14] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Final state: Ready
[2024-05-29T16:50:14] INFO File copies: Final state: Ready
[2024-06-05T15:24:49] INFO Validating config against internal schema files-to-stage
[2024-06-05T15:24:49] INFO 0 UW schema-validation errors found
[2024-06-05T15:24:49] INFO File copies: Initial state: Not Ready
[2024-06-05T15:24:49] INFO File copies: Checking requirements
[2024-06-05T15:24:49] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Initial state: Not Ready
[2024-06-05T15:24:49] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Checking requirements
[2024-06-05T15:24:49] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Requirement(s) ready
[2024-06-05T15:24:49] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Executing
[2024-06-05T15:24:49] INFO Copy src/20240529/12/006/baz -> copy-dst-timedep/baz-2024-05-29T18: Final state: Ready
[2024-06-05T15:24:49] INFO File copies: Final state: Ready

copy-dst-timedep
└── baz-2024-05-29T18
Expand Down
30 changes: 15 additions & 15 deletions docs/sections/user_guide/cli/tools/file/copy-exec.out
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[2024-05-29T16:50:14] INFO Validating config against internal schema files-to-stage
[2024-05-29T16:50:14] INFO 0 UW schema-validation errors found
[2024-05-29T16:50:14] INFO File copies: Initial state: Pending
[2024-05-29T16:50:14] INFO File copies: Checking requirements
[2024-05-29T16:50:14] INFO Copy src/foo -> copy-dst/foo: Initial state: Pending
[2024-05-29T16:50:14] INFO Copy src/foo -> copy-dst/foo: Checking requirements
[2024-05-29T16:50:14] INFO Copy src/foo -> copy-dst/foo: Requirement(s) ready
[2024-05-29T16:50:14] INFO Copy src/foo -> copy-dst/foo: Executing
[2024-05-29T16:50:14] INFO Copy src/foo -> copy-dst/foo: Final state: Ready
[2024-05-29T16:50:14] INFO Copy src/bar -> copy-dst/subdir/bar: Initial state: Pending
[2024-05-29T16:50:14] INFO Copy src/bar -> copy-dst/subdir/bar: Checking requirements
[2024-05-29T16:50:14] INFO Copy src/bar -> copy-dst/subdir/bar: Requirement(s) ready
[2024-05-29T16:50:14] INFO Copy src/bar -> copy-dst/subdir/bar: Executing
[2024-05-29T16:50:14] INFO Copy src/bar -> copy-dst/subdir/bar: Final state: Ready
[2024-05-29T16:50:14] INFO File copies: Final state: Ready
[2024-06-05T15:24:50] INFO Validating config against internal schema files-to-stage
[2024-06-05T15:24:50] INFO 0 UW schema-validation errors found
[2024-06-05T15:24:50] INFO File copies: Initial state: Not Ready
[2024-06-05T15:24:50] INFO File copies: Checking requirements
[2024-06-05T15:24:50] INFO Copy src/foo -> copy-dst/foo: Initial state: Not Ready
[2024-06-05T15:24:50] INFO Copy src/foo -> copy-dst/foo: Checking requirements
[2024-06-05T15:24:50] INFO Copy src/foo -> copy-dst/foo: Requirement(s) ready
[2024-06-05T15:24:50] INFO Copy src/foo -> copy-dst/foo: Executing
[2024-06-05T15:24:50] INFO Copy src/foo -> copy-dst/foo: Final state: Ready
[2024-06-05T15:24:50] INFO Copy src/bar -> copy-dst/subdir/bar: Initial state: Not Ready
[2024-06-05T15:24:50] INFO Copy src/bar -> copy-dst/subdir/bar: Checking requirements
[2024-06-05T15:24:50] INFO Copy src/bar -> copy-dst/subdir/bar: Requirement(s) ready
[2024-06-05T15:24:50] INFO Copy src/bar -> copy-dst/subdir/bar: Executing
[2024-06-05T15:24:50] INFO Copy src/bar -> copy-dst/subdir/bar: Final state: Ready
[2024-06-05T15:24:50] INFO File copies: Final state: Ready

copy-dst
├── foo
Expand Down
20 changes: 10 additions & 10 deletions docs/sections/user_guide/cli/tools/file/link-exec-timedep.out
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[2024-05-29T16:50:14] INFO Validating config against internal schema files-to-stage
[2024-05-29T16:50:14] INFO 0 UW schema-validation errors found
[2024-05-29T16:50:14] INFO File links: Initial state: Pending
[2024-05-29T16:50:14] INFO File links: Checking requirements
[2024-05-29T16:50:14] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Initial state: Pending
[2024-05-29T16:50:14] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Checking requirements
[2024-05-29T16:50:14] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Requirement(s) ready
[2024-05-29T16:50:14] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Executing
[2024-05-29T16:50:14] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Final state: Ready
[2024-05-29T16:50:14] INFO File links: Final state: Ready
[2024-06-05T15:24:50] INFO Validating config against internal schema files-to-stage
[2024-06-05T15:24:50] INFO 0 UW schema-validation errors found
[2024-06-05T15:24:50] INFO File links: Initial state: Not Ready
[2024-06-05T15:24:50] INFO File links: Checking requirements
[2024-06-05T15:24:50] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Initial state: Not Ready
[2024-06-05T15:24:50] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Checking requirements
[2024-06-05T15:24:50] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Requirement(s) ready
[2024-06-05T15:24:50] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Executing
[2024-06-05T15:24:50] INFO Link link-dst-timedep/baz-2024-05-29T18 -> src/20240529/12/006/baz: Final state: Ready
[2024-06-05T15:24:50] INFO File links: Final state: Ready

link-dst-timedep
└── baz-2024-05-29T18 -> ../src/20240529/12/006/baz
Expand Down
30 changes: 15 additions & 15 deletions docs/sections/user_guide/cli/tools/file/link-exec.out
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[2024-05-29T16:50:14] INFO Validating config against internal schema files-to-stage
[2024-05-29T16:50:14] INFO 0 UW schema-validation errors found
[2024-05-29T16:50:14] INFO File links: Initial state: Pending
[2024-05-29T16:50:14] INFO File links: Checking requirements
[2024-05-29T16:50:14] INFO Link link-dst/foo -> src/foo: Initial state: Pending
[2024-05-29T16:50:14] INFO Link link-dst/foo -> src/foo: Checking requirements
[2024-05-29T16:50:14] INFO Link link-dst/foo -> src/foo: Requirement(s) ready
[2024-05-29T16:50:14] INFO Link link-dst/foo -> src/foo: Executing
[2024-05-29T16:50:14] INFO Link link-dst/foo -> src/foo: Final state: Ready
[2024-05-29T16:50:14] INFO Link link-dst/subdir/bar -> src/bar: Initial state: Pending
[2024-05-29T16:50:14] INFO Link link-dst/subdir/bar -> src/bar: Checking requirements
[2024-05-29T16:50:14] INFO Link link-dst/subdir/bar -> src/bar: Requirement(s) ready
[2024-05-29T16:50:14] INFO Link link-dst/subdir/bar -> src/bar: Executing
[2024-05-29T16:50:14] INFO Link link-dst/subdir/bar -> src/bar: Final state: Ready
[2024-05-29T16:50:14] INFO File links: Final state: Ready
[2024-06-05T15:24:49] INFO Validating config against internal schema files-to-stage
[2024-06-05T15:24:49] INFO 0 UW schema-validation errors found
[2024-06-05T15:24:49] INFO File links: Initial state: Not Ready
[2024-06-05T15:24:49] INFO File links: Checking requirements
[2024-06-05T15:24:49] INFO Link link-dst/foo -> src/foo: Initial state: Not Ready
[2024-06-05T15:24:49] INFO Link link-dst/foo -> src/foo: Checking requirements
[2024-06-05T15:24:49] INFO Link link-dst/foo -> src/foo: Requirement(s) ready
[2024-06-05T15:24:49] INFO Link link-dst/foo -> src/foo: Executing
[2024-06-05T15:24:49] INFO Link link-dst/foo -> src/foo: Final state: Ready
[2024-06-05T15:24:49] INFO Link link-dst/subdir/bar -> src/bar: Initial state: Not Ready
[2024-06-05T15:24:49] INFO Link link-dst/subdir/bar -> src/bar: Checking requirements
[2024-06-05T15:24:49] INFO Link link-dst/subdir/bar -> src/bar: Requirement(s) ready
[2024-06-05T15:24:49] INFO Link link-dst/subdir/bar -> src/bar: Executing
[2024-06-05T15:24:49] INFO Link link-dst/subdir/bar -> src/bar: Final state: Ready
[2024-06-05T15:24:49] INFO File links: Final state: Ready

link-dst
├── foo -> ../src/foo
Expand Down
21 changes: 11 additions & 10 deletions recipe/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,30 @@
"packages": {
"dev": [
"black =24.4.*",
"coverage =7.4.*",
"docformatter =1.7.*",
"f90nml =1.4.*",
"iotaa =0.7.*",
"iotaa =0.8.*",
"isort =5.13.*",
"jinja2 =3.1.*",
"jq =1.7.*",
"jsonschema =4.21.*",
"lxml =5.1.*",
"jsonschema =4.22.*",
"lxml =5.2.*",
"make >=3.8",
"mypy =1.9.*",
"mypy =1.10.*",
"pip",
"pylint =3.1.*",
"pytest =8.1.*",
"pylint =3.2.*",
"pytest =8.2.*",
"pytest-cov =5.0.*",
"pytest-xdist =3.5.*",
"python >=3.9,<3.13",
"pyyaml =6.0.*"
],
"run": [
"f90nml =1.4.*",
"iotaa =0.7.*",
"iotaa =0.8.*",
"jinja2 =3.1.*",
"jsonschema =4.21.*",
"lxml =5.1.*",
"jsonschema =4.22.*",
"lxml =5.2.*",
"python >=3.9,<3.13",
"pyyaml =6.0.*"
]
Expand Down
15 changes: 8 additions & 7 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@ requirements:
- pip
run:
- f90nml 1.4.*
- iotaa 0.7.*
- iotaa 0.8.*
- jinja2 3.1.*
- jsonschema 4.21.*
- lxml 5.1.*
- jsonschema 4.22.*
- lxml 5.2.*
- python >=3.9,<3.13
- pyyaml 6.0.*
test:
requires:
- black 24.4.*
- coverage 7.4.*
- docformatter 1.7.*
- isort 5.13.*
- jq 1.7.*
- make >=3.8
- mypy 1.9.*
- pylint 3.1.*
- pytest 8.1.*
- mypy 1.10.*
- pylint 3.2.*
- pytest 8.2.*
- pytest-cov 5.0.*
- pytest-xdist 3.5.*
about:
license: LGPL
5 changes: 2 additions & 3 deletions recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ lint() {
msg Running linter
(
set -eux
pylint .
pylint -j 4 .
)
msg OK
}
Expand All @@ -45,8 +45,7 @@ unittest() {
msg Running unit tests
(
set -eux
coverage run -m pytest -vv .
coverage report
pytest --cov=uwtools -n 4 .
)
msg OK
}
Expand Down
11 changes: 0 additions & 11 deletions src/uwtools/tests/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,6 @@ def fixture_path(suffix: str = "") -> Path:
return fixture_pathobj(suffix)


def fixture_uri(suffix: str = "") -> str:
"""
Returns a file:// URI path to a test-fixture resource file.
:param suffix: A subpath relative to the location of the unit-test fixture resource files. The
prefix path to the resources files is known to Python and varies based on installation
location.
"""
return fixture_pathobj(suffix).as_uri()


def logged(caplog: LogCaptureFixture, msg: str) -> bool:
"""
Does the given message occur in the log capture?
Expand Down
6 changes: 4 additions & 2 deletions src/uwtools/tests/utils/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ def test_readable_file(tmp_path):


def test_readable_nofile():
with file.readable() as f:
assert hasattr(f, "read")
file._stdinproxy.cache_clear()
with patch.object(sys, "stdin", new=StringIO("hello")):
with file.readable() as f:
assert f.read() == "hello"


def test_resource_path():
Expand Down

0 comments on commit 737675c

Please sign in to comment.