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

Broken tests #43

Closed
sebastianbergmann opened this issue Dec 8, 2015 · 4 comments
Closed

Broken tests #43

sebastianbergmann opened this issue Dec 8, 2015 · 4 comments
Labels

Comments

@sebastianbergmann
Copy link
Owner

After finally (sorry!) merging the pull requests sent by @bryanagee, @MajorCaiger, @fatalcoder, and @vpx, there are now failing tests:

PHPUnit 4.8.19 by Sebastian Bergmann and contributors.

FFF

Time: 40 ms, Memory: 4.00Mb

There were 3 failures:

1) SebastianBergmann\PHPCOV\PatchCoverageTest::testPatchCoverageIsCalculatedCorrectly with data set #0 ('patch')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    'numChangedLinesThatAreExecutable' => 2
-    'numChangedLinesThatWereExecuted' => 1
+    'numChangedLinesThatAreExecutable' => 0
+    'numChangedLinesThatWereExecuted' => 0
     'changedLinesThatWereNotExecuted' => Array (
-        'Example.php' => Array (...)
     )
 )

/usr/local/src/phpcov/tests/PatchCoverageTest.php:38

2) SebastianBergmann\PHPCOV\PatchCoverageTest::testPatchCoverageIsCalculatedCorrectly with data set #1 ('patch2')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    'numChangedLinesThatAreExecutable' => 2
-    'numChangedLinesThatWereExecuted' => 1
+    'numChangedLinesThatAreExecutable' => 0
+    'numChangedLinesThatWereExecuted' => 0
     'changedLinesThatWereNotExecuted' => Array (
-        'Example.php' => Array (...)
     )
 )

/usr/local/src/phpcov/tests/PatchCoverageTest.php:38

3) SebastianBergmann\PHPCOV\PatchCoverageTest::testPatchCoverageIsCalculatedCorrectly with data set #2 ('patch3')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    'numChangedLinesThatAreExecutable' => 2
-    'numChangedLinesThatWereExecuted' => 1
+    'numChangedLinesThatAreExecutable' => 0
+    'numChangedLinesThatWereExecuted' => 0
     'changedLinesThatWereNotExecuted' => Array (
-        'Example.php' => Array (...)
     )
 )

/usr/local/src/phpcov/tests/PatchCoverageTest.php:38

FAILURES!
Tests: 3, Assertions: 3, Failures: 3.
@MajorCaiger
Copy link
Contributor

Hi all

I just temporarily reverted my changes locally and the tests still fail. Interestingly, I changed the composer versions of some dependencies, back to a previous version that should be supported, and the test still failed, but with a different output.

Also, on my fork of the repo, the tests were running fine back when I submitted, but now seem to fail after I have composer updated. Could this be related to changes in one of the dependencies? Unfortunately I don't know what the previous versions I was using are.

@MajorCaiger
Copy link
Contributor

HI all

I have just checked out the last commit prior to any of our changes, updates composer and ran the tests.

There are the same failures appearing (See below).

~/Development/Projects/phpcov (master) -> git checkout b890e390724be2ae18189ddd5e717d03f77f0299
Note: checking out 'b890e390724be2ae18189ddd5e717d03f77f0299'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at b890e39... "symfony/finder": "~2.2" -> "symfony/finder": "~2|~3"
-----------------------------------------------------------
~/Development/Projects/phpcov ((b890e39...)) -> composer update
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
-----------------------------------------------------------
~/Development/Projects/phpcov ((b890e39...)) -> phpunit -c build
PHPUnit 4.8.21 by Sebastian Bergmann and contributors.

F

Time: 70 ms, Memory: 5.75Mb

There was 1 failure:

1) SebastianBergmann\PHPCOV\PatchCoverageTest::testPatchCoverageIsCalculatedCorrectly
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    'numChangedLinesThatAreExecutable' => 2
-    'numChangedLinesThatWereExecuted' => 1
+    'numChangedLinesThatAreExecutable' => 0
+    'numChangedLinesThatWereExecuted' => 0
     'changedLinesThatWereNotExecuted' => Array (
-        'Example.php' => Array (...)
     )
 )

/Users/rob/Development/Projects/phpcov/tests/PatchCoverageTest.php:37
phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:179
phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:132

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

My guess is that these failures are due to changes in a composer dependency. I can attempt to narrow it down, but it may take some time. @sebastianbergmann Maybe you could shed a little light?

Thanks

Rob

@MajorCaiger
Copy link
Contributor

Actually....

What I said isn't correct.

For the tests to run, you need to create a file called /tmp/example/Example.php then all tests run correctly.

After doing this locally, all tests run and pass.

I remember getting stuck at this point while I was making my changes.

~/Development/Projects/phpcov {master} -> touch /tmp/example/Example.php
-----------------------------------------------------------
~/Development/Projects/phpcov {master} -> phpunit -c build
PHPUnit 4.8.21 by Sebastian Bergmann and contributors.

...

Time: 70 ms, Memory: 5.50Mb

OK (3 tests, 3 assertions)

Thanks

Rob

@sebastianbergmann
Copy link
Owner Author

Cannot reproduce this anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants