Skip to content
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
Closed

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

seaneble opened this issue Oct 17, 2016 · 1 comment

Comments

@seaneble
Copy link

@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
Copy link
Author

@seaneble 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 Running only one suite still runs all tests -- for end of parameter (option) list does not work Oct 17, 2016
Naktibalda added a commit that referenced this issue Oct 17, 2016
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 added a commit that referenced this issue Oct 22, 2016
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 pushed a commit to chris1312/Codeception that referenced this issue Jun 16, 2017
Fixes Codeception#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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.