galaxyproject / galaxyproject/planemo
Planenmo test with <has_line line="..."> fails when stdout is bigger than 2**14 characters long.
- Dominant language
- Python
- Stars
- 110
- Forks
- 102
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 13
Description
When we run tools the stdout is cut if its length is greater than 2**14 characters.
This behavior causes error in the `has_line` test, as it seems to rely on the "size-reduced" stdout instead of the "whole" stdout.
Success and fail examples
---
Here are two examples of xml tools.
This one works fine because the output will be 1200 chars long:
```xml
python
```
But in this one, the test fails because the stdout is cut in the area shown above:
```xml
python
```
Output is cut here:
```txt
02727
02728
02729
02
..
9
03270
03271
03272
```
So, the line "03000" cannot be found, even if it is present in the logs.
As we can see, the first part of the output is 6*2729+3 (=16377) characters long. Which is only seven characters away from to 2**14 (=16384).
I suppose other tests like `has_text`, `not_has_text`, `has_text_matching` - and so on - will be prone to this problem.
EDIT: `has_text` is error prone too.
tests
---
to test these files; I ran the following script:
```sh
VENV=.venv
TEST_DIR=/tmp/test_tool
if [ ! -d ".venv" ];then
python3 -m virtualenv ${VENV} ;
fi
. ${VENV}/bin/activate
if [ "$(which planemo)" = "" ];then
pip install planemo ;
fi
if [ ! -d "${TEST_DIR}" ];then
planemo conda_install --conda_prefix ${TEST_DIR} . ;
fi
mkdir -p test-data
touch test-data/input.txt
planemo lint --fail_level error ./*.xml || exit 255
planemo test \
--install_galaxy \
--conda_dependency_resolution \
--conda_prefix ${TEST_DIR} \
--no_cleanup \
;
```
Contributor guide
Research direction
Start by running the provided shell reproduction with `planemo test` and the two XML tool examples. Trace the `has_line` and `has_text` checks against the truncated stdout, then verify that assertions can inspect the whole output while any display truncation remains. Done means the `03000` line and longer-text checks pass beyond 2**14 characters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100