hrcorval / behavex

BDD testing solution designed to enhance your Behave-based testing workflows
https://github.com/hrcorval/behavex
MIT License
90 stars 20 forks source link

behavex: error: unrecognized arguments: --parallel-processes=4 #182

Open alexanderilyin opened 2 weeks ago

alexanderilyin commented 2 weeks ago

Describe the bug

behavex --parallel-processes=4
...
behavex: error: unrecognized arguments: --parallel-processes=4

To Reproduce

⬢ [Docker] ❯ behavex --parallel-processes=4
|--------------------| ------------------------------------------------------------|
|ENV. VARIABLE       | VALUE                                                       |
|--------------------| ------------------------------------------------------------|
|HOME                | /home/node                                                  |
|CONFIG              | /workspaces/partcad/.venv/lib/python3.11/site-packages/behavex/conf_behavex.cfg|
|OUTPUT              | /workspaces/partcad/output                                  |
|TAGS                | ----                                                        |
|PARALLEL_SCHEME     | scenario                                                    |
|PARALLEL_PROCESSES  | 4                                                           |
|FEATURES_PATH       | features                                                    |
|TEMP                | /workspaces/partcad/output/temp                             |
|LOGS                | /workspaces/partcad/output/outputs/logs                     |
|LOGGING_LEVEL       | INFO                                                        |
|--------------------| ------------------------------------------------------------|

************************************************************
Running parallel scenarios
************************************************************

usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes=4
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes=4
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes=4
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes=4
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes=4
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes=4
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes=4

3 features passed, 0 failed, 0 skipped
0 scenarios passed, 7 failed, 0 skipped
Took:   0.7s

HTML output report is located at: /workspaces/partcad/output/report.html
Exit code: 1

Expected behavior

No error message

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

⬢ [Docker] ❯ lsb_release -d
No LSB modules are available.
Description:    Debian GNU/Linux 12 (bookworm)
hrcorval commented 1 week ago

Hi @alexanderilyin, I believe this is related to the way argparse library (the one we use to parse the execution arguments) works across platforms. We are working on standardizing the implementation, but in the meantime, can you try executing behavex in the docker container by removing the "=" in the --parallel-proceses argument? Like this: behavex --parallel-processes 4

If it works, the only argument I would suggest to continue using the '=' between the argument and the value, is --tags (or -t)

alexanderilyin commented 1 week ago

Nope, didn't change much:

⬢ [Docker] ❯ behavex --parallel-processes 4
|--------------------| ------------------------------------------------------------|
|ENV. VARIABLE       | VALUE                                                       |
|--------------------| ------------------------------------------------------------|
|HOME                | /home/node                                                  |
|CONFIG              | /workspaces/partcad/.venv/lib/python3.11/site-packages/behavex/conf_behavex.cfg|
|OUTPUT              | /workspaces/partcad/output                                  |
|TAGS                | ----                                                        |
|PARALLEL_SCHEME     | scenario                                                    |
|PARALLEL_PROCESSES  | 4                                                           |
|FEATURES_PATH       | features                                                    |
|TEMP                | /workspaces/partcad/output/temp                             |
|LOGS                | /workspaces/partcad/output/outputs/logs                     |
|LOGGING_LEVEL       | INFO                                                        |
|--------------------| ------------------------------------------------------------|

************************************************************
Running parallel scenarios
************************************************************

usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+
behavex: error: unrecognized arguments: --parallel-processes

9 features passed, 0 failed, 0 skipped
0 scenarios passed, 18 failed, 0 skipped
Took:   2s

HTML output report is located at: /workspaces/partcad/output/report.html
Exit code: 1

Thanks for the hint, when time allows I should be able to fork the repo and take a closer look, I also might suggest looking at https://github.com/pallets/click for the CLI interface, meanwhile I'm using this:

parallel behave ::: $(echo $(find features -type f -name '*.feature'))
alexanderilyin commented 1 week ago

Here is my other attempt on potato scaling of behave:

alexanderilyin commented 3 hours ago

Well, debuger does not help much with whatever happens in sub processes. My current understanding is that something goes wrong around process_pool.submit(...). Also if I look on the error message:

behavex: error: unrecognized arguments: --parallel-processes
usage: behavex [options] [ [DIR|FILE|FILE:LINE] ]+

It looks if like --parallel-processes 2 was passed to behave executable:

⬢ [Docker] ❯ behave --parallel-processes 2
usage: behave [options] [ [DIR|FILE|FILE:LINE] ]+
behave: error: unrecognized arguments: --parallel-processes
alexanderilyin commented 3 hours ago

@hrcorval I can tell the following:

  1. Problem is reproducible when both behave and behavex are installed by poetry in the same venv.
  2. Problem is NOT reproducible when behavex is installed via pipx
    • but it leads a lot of problem with missing yaml and hamcrest and other modules I import in features/steps/*.py

but overall it seems to "work" if behavex installed via pipx:

...
2 features passed, 12 failed, 6 skipped
11 scenarios passed, 26 failed, 74 skipped
Took:  3m 7s
alexanderilyin commented 3 hours ago

My plan is:

  1. Use conda to install behavex in isolation with all needed deps.
  2. Make a reproduce env for you.