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

Don't run test if exception was thrown in _before of a module #4197

Merged
merged 2 commits into from May 8, 2017

Conversation

Projects
None yet
3 participants
@Naktibalda
Member

Naktibalda commented May 5, 2017

I fixed that for all test formats except Unit - it has to be fixed in PHPUnit.
One more reason to use Codeception formats.

Closes #4191

} catch (\Exception $er) {
// failure is created: not a user's test code error so we don't need detailed stacktrace
$this->testResult->addError($this, new \PHPUnit_Framework_AssertionFailedError($er->getMessage()), 0);
$this->ignored = true;

This comment has been minimized.

@DavertMik

DavertMik May 8, 2017

Member

not sure why the test was executed even when it was marked as ignored 😕

@DavertMik

DavertMik May 8, 2017

Member

not sure why the test was executed even when it was marked as ignored 😕

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik May 8, 2017

Member

Thanks. Very nice fix

Member

DavertMik commented May 8, 2017

Thanks. Very nice fix

@DavertMik DavertMik merged commit d24aa1e into Codeception:2.2 May 8, 2017

4 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details
wercker/build Wercker pipeline passed
Details
@nebosklondev

This comment has been minimized.

Show comment
Hide comment
@nebosklondev

nebosklondev May 21, 2017

I run 26 tests. And if the second does not pass, then all other tests are not performed. It's horrible.

I run 26 tests. And if the second does not pass, then all other tests are not performed. It's horrible.

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda May 21, 2017

Member

I know, it is fixed already and will be released soon.
Please downgrade to 2.2.10 if 2.2.11 is unusable.

Member

Naktibalda commented May 21, 2017

I know, it is fixed already and will be released soon.
Please downgrade to 2.2.10 if 2.2.11 is unusable.

@Naktibalda Naktibalda deleted the Naktibalda:dont-run-test-if-before-failed branch May 21, 2017

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

Don't run test if exception was thrown in _before of a module (#4197)
* Created tests for execution when exception is thrown in _before of module

* Don't run test if exception was thrown in _before of module

Works in all formats except Unit
Closes #4191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment