silkaj issueshttps://git.duniter.org/clients/python/silkaj/-/issues2021-04-08T14:18:22+02:00https://git.duniter.org/clients/python/silkaj/-/issues/147Add integration tests2021-04-08T14:18:22+02:00Sébastien DA ROCHAAdd integration testsAccording to https://git.duniter.org/clients/python/silkaj/merge_requests/83#note_11369
We can make some simple end to end test, but to ensure data is correct, we should use something to mock the blockchain, either by using duniterpy-mi...According to https://git.duniter.org/clients/python/silkaj/merge_requests/83#note_11369
We can make some simple end to end test, but to ensure data is correct, we should use something to mock the blockchain, either by using duniterpy-mirage or by using a generic tool like betamax (records the http requests while play the test for the first time, and replay the record the next times).Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/187Certification confirmation tests broken since Click.confirm() and async usage2022-06-26T22:35:56+02:00MoulCertification confirmation tests broken since Click.confirm() and async usage- Since `click.confirm()` usage in e7b6e26.
- [x] Should be fixable with https://click.palletsprojects.com/en/7.x/testing/#input-streams
- Since asynchronism usage in 583c3d4:
- [x] #225: Install [pytest-asyncio](https://pypi.org/pro...- Since `click.confirm()` usage in e7b6e26.
- [x] Should be fixable with https://click.palletsprojects.com/en/7.x/testing/#input-streams
- Since asynchronism usage in 583c3d4:
- [x] #225: Install [pytest-asyncio](https://pypi.org/project/pytest-asyncio/)
- [ ] Unfortunately, Click does not handle async. And the return `Result` object does not contains values but only defaults one. It does return like a coroutine instead of the `Result` object.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/197Lock features with tests2022-03-13T18:09:27+01:00MoulLock features with tests## Commands
- [ ] `about`
- [ ] `authfile`, every kind of authentication files
- [ ] `balance`,
- [ ] `blocks`
- [ ] `cert`: #375: every use cases
- [ ] `diffi`
- [ ] `history`: #339
- [ ] `info`
- [ ] #221: `license` behavior
- [ ] `lo...## Commands
- [ ] `about`
- [ ] `authfile`, every kind of authentication files
- [ ] `balance`,
- [ ] `blocks`
- [ ] `cert`: #375: every use cases
- [ ] `diffi`
- [ ] `history`: #339
- [ ] `info`
- [ ] #221: `license` behavior
- [ ] `lookup`
- [ ] ~~`net`~~
- [x] `tx`: !130: intermediaries tx, multi-output tx
- [ ] `wot`
## Code
- [ ] authentication
- [ ] network part
## Tool
- [pytest-click](https://github.com/Stranger6667/pytest-click): click module fixture for Pytest.
- [duniter-mirage](https://git.duniter.org/clients/python/duniter-mirage)Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/222Write a test for wot.identities_from_pubkeys()2022-06-26T22:35:48+02:00MoulWrite a test for wot.identities_from_pubkeys()> Linked to #219
> Blocked by #223> Linked to #219
> Blocked by #223Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/283Common code between verify and blocks2023-10-21T09:01:48+02:00MoulCommon code between verify and blocks> Following #262
### Tasks
- [ ] common function to gather a range of blocks specifying `from_`, and `to`.
- [ ] common test on this function gathering blocks on a range by chunks
- [ ] two modes for `blocks` explorer:
- current: spec...> Following #262
### Tasks
- [ ] common function to gather a range of blocks specifying `from_`, and `to`.
- [ ] common test on this function gathering blocks on a range by chunks
- [ ] two modes for `blocks` explorer:
- current: specify number of blocks from head, 0 default to current window
- [ ] Same as verify: a range of blocks: blocks number `from` an `to`.
- [ ] How to specify/filter the two modes: `--range`, `--from-head`/`--head` (this one would be the default).
This could be a method into a class that would inherit the `@click.command` decorator. Would that work?
---
### Later
- [ ] command `blocks` with sub-commands `explorer`, `verify`, …: is this possible with Click?Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/303Mutually exclusion options tests on tx are not properly defined2021-04-07T15:56:02+02:00MoulMutually exclusion options tests on tx are not properly definedThe tests checking the CLI `tx` on mutually exclusion options (`amount(s)(UD)/allSources`) is not properly done. On !108, when we changed the options’ name from `amount(UD)` to `amounts(UD)`, we were not able see a broken feature (mutual...The tests checking the CLI `tx` on mutually exclusion options (`amount(s)(UD)/allSources`) is not properly done. On !108, when we changed the options’ name from `amount(UD)` to `amounts(UD)`, we were not able see a broken feature (mutual exclusions)
The feature is tested by checking that it is failing on the missing `--output/recipients` option. And, it looks like this is the first error to occur much before the mutual exclusion check.
To test this propely, we would need to pass `-r` option as well, then we should find a way to check/bypass the Scrypt authentication inputs.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/328Import modules in an upper level to not cause issue while monkeypatching2022-03-13T18:09:28+01:00MoulImport modules in an upper level to not cause issue while monkeypatching### Problem
Following `pep8` recommendations to import just the necessary function used in the code.
And following what I heard about importing just the minimum to speed-up the program start-up, and may be decrease the memory usage by ke...### Problem
Following `pep8` recommendations to import just the necessary function used in the code.
And following what I heard about importing just the minimum to speed-up the program start-up, and may be decrease the memory usage by keeping the minimum libs in the memory.
This two above statement made silkaj runtime code just import the strict minimum of what's used.
We are now starting to write more and more tests, and this caused troubles. Monkeypatching wasn't working due to import issues.
[This article](https://medium.com/@chipiga86/python-monkey-patching-like-a-boss-87d7ddb8098e) explains why the monkey patching is sometimes not working due to import issues. As a summary, this is due to how the modules are imported. Once imported and cached, it can not be changed. But, if you import at a higher level, via the above module, the patching is working.
### Solution
This ticket is just about changing the modules import, by importing them from a higher level:
```
from silkaj import tx
tx.send_transaction()
tx.confirmation_chart()
```
We could import a whole file, a class, but not a function nor a method, otherwise we would get annoyed by non-working monkeypatching.
This also allow to know from which library the f() is coming from, the context. There will be less effort tracking which function is use/is no more used and can be removed.
The idea is to get into this direction. We could still import function and method if wished.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/339Write unit test on tx_history command2021-04-08T14:20:28+02:00MoulWrite unit test on tx_history commandCurrently, there is just integration tests on the `history` command.
Except for !141, unit testing this command should be done.
This code base might be rework with GVA and/or a new interface.Currently, there is just integration tests on the `history` command.
Except for !141, unit testing this command should be done.
This code base might be rework with GVA and/or a new interface.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/354Write test to lock the ability to use Silkaj without Click context2021-08-10T21:38:31+02:00MoulWrite test to lock the ability to use Silkaj without Click context- [ ] Since Python 3.5 has been dropped, we can use `ModuleNotFoundError` exception.
- https://docs.python.org/3/library/exceptions.html#ModuleNotFoundError
- [ ] Write tests- [ ] Since Python 3.5 has been dropped, we can use `ModuleNotFoundError` exception.
- https://docs.python.org/3/library/exceptions.html#ModuleNotFoundError
- [ ] Write testsBackloghttps://git.duniter.org/clients/python/silkaj/-/issues/375Write unit tests for 'certify' command2023-05-30T16:44:53+02:00MoulWrite unit tests for 'certify' commandBackloghttps://git.duniter.org/clients/python/silkaj/-/issues/376Replace tools.message_exit() with sys.exit()2023-11-13T14:27:15+01:00MoulReplace tools.message_exit() with sys.exit()`sys.exit()` can print an error and send the appropriate error status to the shell.`sys.exit()` can print an error and send the appropriate error status to the shell.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/379Run `test_membership_cmd()` without sending the document2022-06-05T15:24:38+02:00MoulRun `test_membership_cmd()` without sending the document> To be done after #378.
Run `test_membership_cmd()` without sending the document by running `patched_send_document.assert_awaited_once_with()`> To be done after #378.
Run `test_membership_cmd()` without sending the document by running `patched_send_document.assert_awaited_once_with()`Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/382Move and rewrite test_end_to_end.py tests with click.invoke()2022-12-12T20:38:20+01:00MoulMove and rewrite test_end_to_end.py tests with click.invoke()- [ ] #399: Use `click.invoke()` instead of `subprocess`
- [ ] Write unit tests to stop doing requests on the network
- [ ] Move tests to the appropriate files
- [ ] CI: Try to run `poetry install --no-root` in the tests to speed-up (`si...- [ ] #399: Use `click.invoke()` instead of `subprocess`
- [ ] Write unit tests to stop doing requests on the network
- [ ] Move tests to the appropriate files
- [ ] CI: Try to run `poetry install --no-root` in the tests to speed-up (`silkaj` command shouldn’t be necessary anymore).Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/389Write unit test for lookup cmd2021-03-31T08:42:01+02:00MoulWrite unit test for lookup cmd> Follow up !171> Follow up !171Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/399Use click.CliRunner instead of check_output for testing2023-06-05T10:03:08+02:00matograineUse click.CliRunner instead of check_output for testingsee this [message](https://git.duniter.org/clients/python/silkaj/-/merge_requests/179#note_27418).
Tests using `check_output()` result in not passing on some local installations (here on Debian10).
They could use `click.CliRunner` inste...see this [message](https://git.duniter.org/clients/python/silkaj/-/merge_requests/179#note_27418).
Tests using `check_output()` result in not passing on some local installations (here on Debian10).
They could use `click.CliRunner` instead.
This only concerns `tests/test_end_to_end.py` file.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/463Consider Ward test framework2023-04-10T14:50:27+02:00MoulConsider Ward test framework- https://github.com/darrenburns/ward
- https://ward.readthedocs.io/en/latest/- https://github.com/darrenburns/ward
- https://ward.readthedocs.io/en/latest/Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/482Add support for Python v3.132023-11-20T14:27:16+01:00MoulAdd support for Python v3.13### Python pre-releases
- [ ] Set up v3.13 test job
- [ ] With `allow_failure: true`, to allow tests to fail
### Python stable release
- [ ] Remove `allow_failure: true`, now on the tests should pass
- [ ] Move coverage to v3.13 job
-...### Python pre-releases
- [ ] Set up v3.13 test job
- [ ] With `allow_failure: true`, to allow tests to fail
### Python stable release
- [ ] Remove `allow_failure: true`, now on the tests should pass
- [ ] Move coverage to v3.13 job
- [ ] Set default container used by jobs to v3.13
- [ ] Handle deprecation warning and breaking features
- [ ] Switch Silkaj image build to v3.13
### Post
- [ ] Open follow-up v3.14 tickets
### References
- Expected to be release the [October 1st 2024](https://peps.python.org/pep-0719/).
- docker/python3/poetry#10+
- clients/python/duniterpy#208+0.20.02024-10-01