Commit Graph

14 Commits

Author SHA1 Message Date
dustinface
25d30a4c72
tests: Fix and improve plot manager caching tests (#9785)
* tests: Fix plot manager caching tests

The new plot manager was compared to itself instead to the one from the 
test environment. This is an old issue introduced in #8875.

* tests: Compare the loaded cache data also, not only the cache size
2022-01-13 17:41:15 -08:00
dustinface
86e7d694d2
tests: Avoid unintentional refresh cycles in test_plot_manager.py (#9603) 2021-12-20 10:38:11 -08:00
dustinface
2ab146bf2d
plotting|tests|github: Fix and test re-loading/removal of plots where we missed the keys (#9578)
* tests: Allow to use custom keys in `BlockTools.new_plot`

* tests: Create three plots with `G1Element()` as farmer/pool key

But not add them as default plots. Just to have plots in the test cache with different keys from
within and outside the keychain for plot loading tests.

create

* test|github: Bump `test-cache` version to `0.28.0`

* plotting: Drop plots from `no_key_filenames` after the keys appeared

* plotting: Drop plots from `no_key_filenames` if the plot was removed

* tests: Test loading of plots where we miss the keys

* plotting: Use `x.copy()` instead of `list(x)`

* plotting: Add a comment about the missing keys plot removal

* tests: Fix after #9595
2021-12-17 14:36:29 -08:00
dustinface
234d121c2a
chia|tests|pre-commit: Add missing __init__.py files (#8758)
* chia|tests: Add missing `__init__.py` files

* check and create needed __init__.py files via pre-commit

* plotting|tests: Handle `mypy` issues introduced by the `main` rebase

* pre-commit: Run `build-init-files.py` more verbose

* tests: Ignore `__pycache__` folders in `build-init-files.py`

* Update tests/build-init-files.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Update tests/build-init-files.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* tests: Add shebang, make executable, add description

To `tests/build-init-files.py`

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2021-12-16 18:52:46 -08:00
dustinface
08b5d68f2c
tests: Move the expected_result_matched assignment out of the loop (#9595)
* tests: Move the `expected_result_matched` assignment out of the loop

This issue was introduced in #9505 and leads to false positives as soon 
as there was one of the attributes in `PlotRefreshResult` checked to be 
valid followed by an invalid one.

* tests: Fix `test_invalid_plots`
2021-12-16 18:52:32 -08:00
dustinface
aabc54bb53
plotting|tests: Fix try/except in PlotManager._refresh_task (#9588)
* plotting: Fix try/except in `PlotManager._refresh_task`

* tests: Move the start refreshing call into `PlotRefreshTester` ctor

It being in `run()` before where it was called every test iteration lead
to not detecting an issue with the try/except introduced in #9409. See
ee1dd1912f4678d7b960b670473bd4b3ffbd890b for the fix.
2021-12-16 15:14:34 -08:00
dustinface
a68ffecea1
plotting|tests: Fix and test removal of invalid plots (#9587)
* plotting: Drop from `failed_to_open_filenames` if the plot was removed

* tests: Test removal from `failed_to_open_filenames`
2021-12-16 15:14:12 -08:00
dustinface
5496dc1971
tests: Call stop_refreshing in the test_environment fixture (#9567) 2021-12-15 15:27:37 -08:00
dustinface
47c02aabd2
tests: Rework callback expectation checks with PlotRefreshTester (#9505) 2021-12-13 08:41:24 -08:00
dustinface
8e6b7afa79
tests: Some cleanups after #9306 and #9409 (#9503)
* tests: Drop `None` check and compare the events directly

* tests: Drop unused `TestRefreshResult`
2021-12-10 09:18:51 -08:00
dustinface
ad7b549cbd
plotting|tests: Catch exceptions in the plot manager thread (#9409)
Without this the plot manager thread silently dies on exceptions and
refreshing just stops. This change leads to refreshing reset and a error
log on exceptions.
2021-12-07 09:57:24 -08:00
dustinface
59b8be5f72
chia|tests: Pass the loaded/removed plots with PlotRefreshResult (#9306)
* chia|tests: Pass the loaded/removed plots with `PlotRefreshResult`

Instead of just the counts.

* plotting: Default to `False` for `expected_result_matched`

* tests: Validate the loaded/removed plots match the expectations
2021-12-06 07:53:26 -08:00
dustinface
3c21db387c
tests: Fix test environment creation in test_plot_manager.py (#9370)
The `bt.refresh_plots()` wasn't even awaited and the test environments 
all shared the same root. Now every environment gets its own temp 
directory where the plots relevant for the tests are copied to.
2021-11-27 18:20:08 -08:00
dustinface
7178d47d3a
tests|github: Improve PlotManager tests + move them to test_plot_manager.py (#8875)
* tests: Improve `PlotManager` tests + move them to `test_plot_manager.py`

* github|tests: Enable `plotting` tests and generate the workflow files
2021-11-17 06:54:25 -08:00