New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-- for end of parameter (option) list does not work #3614

Closed
seaneble opened this Issue Oct 17, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@seaneble

seaneble commented Oct 17, 2016

What are you trying to achieve?

I'd like to execute only my unit tests, skipping acceptance tests for the time being. This should be supported, according to docs:

./vendor/bin/codecept run unit

What do you get instead?

All three suites are executed:

Provide console output if related. Use -vvv mode for more details.

Functional Tests (0) ---------------------------------------------------------
------------------------------------------------------------------------------

Unit Tests (1) ---------------------------------------------------------------
E RedirectTest: Redirect create (0.28s)
------------------------------------------------------------------------------

Acceptance Tests Tests (12) ---------------------------------------------------------
[…]
------------------------------------------------------------------------------

Details

  • Codeception version: 2.2.5
  • PHP Version: 7.0
  • Operating System: RHEL 7
  • Installation type: Composer
@seaneble

This comment has been minimized.

Show comment
Hide comment
@seaneble

seaneble Oct 17, 2016

I think this bug report is invalid.

My actual command was

run --coverage --coverage-text unit

which lead to the above situation. This is because the option coverage-text leaves room for a potential second argument and swallows the suite name.

I could get around that by using

run --coverage --coverage-text --no-exit unit

I nevertheless did not close the issue, because this is not perfect. I think the correct way to call the script in this case would be

run --coverage --coverage-text -- unit

to signal the end of all arguments. But this does not work:

  [Symfony\Component\Console\Exception\InvalidArgumentException]  
  The "--" option does not exist.

seaneble commented Oct 17, 2016

I think this bug report is invalid.

My actual command was

run --coverage --coverage-text unit

which lead to the above situation. This is because the option coverage-text leaves room for a potential second argument and swallows the suite name.

I could get around that by using

run --coverage --coverage-text --no-exit unit

I nevertheless did not close the issue, because this is not perfect. I think the correct way to call the script in this case would be

run --coverage --coverage-text -- unit

to signal the end of all arguments. But this does not work:

  [Symfony\Component\Console\Exception\InvalidArgumentException]  
  The "--" option does not exist.

@seaneble seaneble changed the title from Running only one suite still runs all tests to -- for end of parameter (option) list does not work Oct 17, 2016

Naktibalda added a commit that referenced this issue Oct 17, 2016

-- separates options from arguments in codecept run
Fixes #3614

This is a correct way to handle `--`
But it is potentially breaking, because commands like `codecept run --coverage-html -- unit --steps` will no longer work.
The correct way to write that one is `codecept run --coverage-html --steps -- unit`

@DavertMik DavertMik closed this in #3615 Oct 22, 2016

DavertMik added a commit that referenced this issue Oct 22, 2016

-- separates options from arguments in codecept run (#3615)
Fixes #3614

This is a correct way to handle `--`
But it is potentially breaking, because commands like `codecept run --coverage-html -- unit --steps` will no longer work.
The correct way to write that one is `codecept run --coverage-html --steps -- unit`

chris1312 added a commit to chris1312/Codeception that referenced this issue Jun 16, 2017

-- separates options from arguments in codecept run (#3615)
Fixes #3614

This is a correct way to handle `--`
But it is potentially breaking, because commands like `codecept run --coverage-html -- unit --steps` will no longer work.
The correct way to write that one is `codecept run --coverage-html --steps -- unit`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment