galaxyproject / galaxyproject/planemo

Does planemo 0.72.0 test ignore PLANEMO_GLOBAL_WORKSPACE? It won't accept a --directory argument either

Open
#1,097 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
110
Forks
102
Avg merge
4d 21h
Merged PRs (30d)
13

Description

Using the test command in 0.72.0 and trying to force planemo to use a specific directory - not the default ~/.planemo

In cli.py there's an option:

```
@click.option('--directory',
default="~/.planemo",
envvar="PLANEMO_GLOBAL_WORKSPACE",
help="Workspace for planemo.")
```
test won't accept a --directory parameter. and ignores the envvar as far as I can tell

```
(venv) 1 ross@rosspn50:/tmp$ echo $PLANEMO_GLOBAL_WORKSPACE
/tmp/foo

(venv) ross@rosspn50:/tmp$ planemo test --directory /tmp/foo --galaxy_root ~/galthrow ~/rossgit/toolfactory/rgToolFactory2.xml
Usage: planemo test [OPTIONS] TOOL_PATH
Try 'planemo test --help' for help.

Error: no such option: --directory
```

but when I run test with the envvar set, it still tries to use /home/ross/.planemo/gx_venv_3 instead of /tmp/foo

```
(venv) ross@rosspn50:/tmp$ planemo test --galaxy_root ~/galthrow ~/rossgit/toolfactory/rgToolFactory2.xml
Testing using galaxy_root /home/ross/galthrow
Testing tools with command [cd /home/ross/galthrow && if [ -d .venv ] || [ -f dist-eggs.ini ]; then GALAXY_VIRTUAL_ENV=.venv; else **GALAXY_VIRTUAL_ENV=/home/ross/.planemo/gx_venv_3**; fi && export GALAXY_VIRTUAL_ENV && if [ ! -e "$GALAXY_VIRTUAL_ENV" ]; then /home/ross/venv/bin/virtualenv -p /home/ross/venv/bin/python3 $GALAXY_VIRTUAL_ENV; echo "Created virtualenv"; fi && if [ -e "$GALAXY_VIRTUAL_ENV" ]; then . "$GALAXY_VIRTUAL_ENV"/bin/activate; echo "Activated a virtualenv for Galaxy"; echo "$VIRTUAL_ENV"; else echo "Failed to activate virtualenv."; fi && sh run_tests.sh $COMMON_STARTUP_ARGS --report_file /tmp/tool_test_output.html --xunit_report_file /tmp/tmpcmdb0mkb/xunit.xml --structured_data_report_file /tmp/tool_test_output.json functional.test_toolbox]
galaxy.util.commands WARNING: Passing program arguments as a string may be a security hazard if combined with untrusted input
Activated a virtualenv for Galaxy
/home/ross/galthrow/.venv
Activating virtualenv at .venv
Requirement already satisfied: pip>=8.1 in ./.venv/lib/python3.6/site-packages (20.1)
^CERROR: Operation cancelled by user
WARNING: You are using pip version 20.1; however, version 20.2.4 is available.
You should consider upgrading via the '/home/ross/galthrow/.venv/bin/python -m pip install --upgrade pip' command.
```

Contributor guide

Open the contributing guide

Research direction

Start in cli.py with the --directory option and reproduce the reported planemo test commands using --directory and PLANEMO_GLOBAL_WORKSPACE. Trace how the test command receives workspace settings; done means both the option and environment variable select the requested workspace instead of ~/.planemo.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.