con / duct

A helper to run a command, capture stdout/stderr and details about running
MIT License
1 stars 1 forks source link

speed up execution tests #46

Open asmacdo opened 3 weeks ago

asmacdo commented 3 weeks ago

They aren't miserably slow, but we can tweak (and standardize) the time values in the test_execution args and probably make this blazing fast. Doesn't seem crucial to block release though.

duct pytest test/test_execution.py
duct is executing pytest test/test_execution.py...
Log files will be written to .duct/logs/2024.06.06T17.49.26-444723_
============================= test session starts ==============================
platform linux -- Python 3.11.5, pytest-7.4.4, pluggy-1.5.0
rootdir: /home/austin/devel/duct
configfile: tox.ini
plugins: cov-5.0.0
collected 8 items

test/test_execution.py ........                                          [100%]

============================== 8 passed in 4.20s ===============================

Exit Code: 0
Command: pytest test/test_execution.py
Log files location: .duct/logs/2024.06.06T17.49.26-444723_
Wall Clock Time: 4.352977275848389
Memory Peak Usage: 0.1%
CPU Peak Usage: 18.0%
 austin@fancy  ~/devel/duct   next ± duct pytest
duct is executing pytest...
Log files will be written to .duct/logs/2024.06.06T17.46.28-441631_
============================= test session starts ==============================
platform linux -- Python 3.11.5, pytest-7.4.4, pluggy-1.5.0
rootdir: /home/austin/devel/duct
configfile: tox.ini
plugins: cov-5.0.0
collected 38 items

test/test_execution.py ........                                          [ 21%]
test/test_helpers.py .....                                               [ 34%]
test/test_prepare_outputs.py ......                                      [ 50%]
test/test_report.py ....                                                 [ 60%]
test/test_tailpipe.py ...............                                    [100%]

============================== 38 passed in 5.71s ==============================

Exit Code: 0
Command: pytest
Log files location: .duct/logs/2024.06.06T17.46.28-441631_
Wall Clock Time: 5.862141370773315
Memory Peak Usage: 0.6%
CPU Peak Usage: 29.0%
austin@fancy  ~/devel/duct   next ± duct tox
duct is executing tox...
Log files will be written to .duct/logs/2024.06.06T17.46.41-442524_
.pkg: _optional_hooks> python /home/austin/miniconda3/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_sdist> python /home/austin/miniconda3/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_wheel> python /home/austin/miniconda3/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: prepare_metadata_for_build_wheel> python /home/austin/miniconda3/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: build_sdist> python /home/austin/miniconda3/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
lint: install_package> python -I -m pip install --force-reinstall --no-deps /home/austin/devel/duct/.tox/.tmp/package/368/duct-0.0.1.tar.gz
lint: commands[0]> flake8 src test
lint: OK ✔ in 2.47 seconds
typing: install_package> python -I -m pip install --force-reinstall --no-deps /home/austin/devel/duct/.tox/.tmp/package/369/duct-0.0.1.tar.gz
typing: commands[0]> mypy src test
src/duct.py:59: error: Need type annotation for "max_values"  [var-annotated]
src/duct.py:61: error: Need type annotation for "_sample"  [var-annotated]
src/duct.py:64: error: Name "command" already defined on line 35  [no-redef]
src/duct.py:333: error: Incompatible types in assignment (expression has type "None", variable has type "TextIO | TailPipe | int")  [assignment]
src/duct.py:343: error: Incompatible types in assignment (expression has type "None", variable has type "TextIO | TailPipe | int")  [assignment]
Found 5 errors in 1 file (checked 8 source files)
typing: exit 1 (0.34 seconds) /home/austin/devel/duct> mypy src test pid=442917
typing: FAIL ✖ in 2.1 seconds
py38: skipped because could not find python interpreter with spec(s): py38
py38: SKIP ⚠ in 0.01 seconds
py39: skipped because could not find python interpreter with spec(s): py39
py39: SKIP ⚠ in 0.01 seconds
py310: skipped because could not find python interpreter with spec(s): py310
py310: SKIP ⚠ in 0.01 seconds
py311: install_package> python -I -m pip install --force-reinstall --no-deps /home/austin/devel/duct/.tox/.tmp/package/370/duct-0.0.1.tar.gz
py311: commands[0]> pytest test
============================= test session starts ==============================
platform linux -- Python 3.11.5, pytest-8.2.0, pluggy-1.5.0
cachedir: .tox/py311/.pytest_cache
rootdir: /home/austin/devel/duct
configfile: tox.ini
plugins: mock-3.14.0, cov-5.0.0
collected 38 items

test/test_execution.py ........                                          [ 21%]
test/test_helpers.py .....                                               [ 34%]
test/test_prepare_outputs.py ......                                      [ 50%]
test/test_report.py ....                                                 [ 60%]
test/test_tailpipe.py ...............                                    [100%]

============================== 38 passed in 5.55s ==============================
py311: OK ✔ in 7.42 seconds
py312: skipped because could not find python interpreter with spec(s): py312
py312: SKIP ⚠ in 0.01 seconds
pypy3: skipped because could not find python interpreter with spec(s): pypy3
  lint: OK (2.47=setup[2.32]+cmd[0.15] seconds)
  typing: FAIL code 1 (2.10=setup[1.76]+cmd[0.34] seconds)
  py38: SKIP (0.01 seconds)
  py39: SKIP (0.01 seconds)
  py310: SKIP (0.01 seconds)
  py311: OK (7.42=setup[1.71]+cmd[5.71] seconds)
  py312: SKIP (0.01 seconds)
  pypy3: SKIP (0.01 seconds)
  evaluation failed :( (12.06 seconds)

Exit Code: 255
Command: tox
Log files location: .duct/logs/2024.06.06T17.46.41-442524_
Wall Clock Time: 12.165053367614746
Memory Peak Usage: 0.7%
CPU Peak Usage: 89.5%