tag:help.appveyor.com,2012-11-13:/discussions/problems/17550-appveyor-stopped-running-my-phpunit-testsAppVeyor: Discussion 2018-12-23T21:00:18Ztag:help.appveyor.com,2012-11-13:Comment/462930352018-10-19T17:44:45Z2018-10-19T17:44:45ZAppveyor stopped running my phpunit tests<div><p>Can you turn off caching and try running a build.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/462930352018-10-19T22:02:28Z2018-10-19T22:02:28ZAppveyor stopped running my phpunit tests<div><p>I commented out the cache directives in my appveyor.yml file, and added a couple of environment vairables through the Admin API to prevent restoring and saving the cache. The rebuild is here:</p>
<p><a href="https://ci.appveyor.com/project/greg-1-anderson/output-formatters/builds/19651457">https://ci.appveyor.com/project/greg-1-anderson/output-formatters/b...</a></p>
<p>The results are the same.</p></div>Greg Andersontag:help.appveyor.com,2012-11-13:Comment/462930352018-10-19T22:32:48Z2018-10-19T22:32:48ZAppveyor stopped running my phpunit tests<div><p>What if you go to the last build in which the tests were detected, and hit <code>Rebuild Commit</code> button?</p>
<p>I notice that on some previous builds that worked the version of <strong>PHPUnit</strong> was 4.<em>.</em> while on the ones that fail it is 5.<em>.</em>. How is that version being set?</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/462930352018-10-19T22:57:06Z2018-10-19T22:57:06ZAppveyor stopped running my phpunit tests<div><p>I cannot rebuild old passing builds, because appveyor complains that the<br>
pull request is now closed.</p>
<p>Here's an old failing build that is still on phpunit 4:</p>
<p><a href="https://ci.appveyor.com/project/greg-1-anderson/output-formatters/builds/14590571">https://ci.appveyor.com/project/greg-1-anderson/output-formatters/b...</a></p>
<p>phpunit is one of my composer dev dependencies; it is installed via<br>
Composer into vendor/bin.</p>
<pre>
<code>- Greg</code>
</pre></div>Greg Andersontag:help.appveyor.com,2012-11-13:Comment/462930352018-10-20T01:19:40Z2018-10-20T01:19:40ZAppveyor stopped running my phpunit tests<div><p>I have no precise understanding of how it's occurring but I strongly suspect the problem lies in the lock file, since, in builds in which the tests are discovered there is the warning in the logs <code>Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.</code></p>
<p>From what I can tell, in all the builds where the tests are ignored there is no such warning. Unless you have a counter example.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/462930352018-10-21T01:57:32Z2018-10-21T01:57:33ZAppveyor stopped running my phpunit tests<div><p>I found a couple other project with a very similar configuration: same<br>
version of Composer, same version of phpunit, pretty similar setup. It<br>
works fine. Here's a successful build from each:</p>
<p><a href="https://ci.appveyor.com/project/greg-1-anderson/site-alias/builds/18967015">https://ci.appveyor.com/project/greg-1-anderson/site-alias/builds/1...</a><br>
<a href="https://ci.appveyor.com/project/greg-1-anderson/hubph">https://ci.appveyor.com/project/greg-1-anderson/hubph</a></p>
<p>I also found another project that is failing in the same way (phpunit<br>
claims there are no tests):</p>
<p><a href="https://ci.appveyor.com/project/greg-1-anderson/annotated-command/builds/19661775">https://ci.appveyor.com/project/greg-1-anderson/annotated-command/b...</a></p>
<p>I've looked at these projects and I can't figure out what's different<br>
between the ones that do not find their tests, and the ones that do.</p>
<p>Also, I'm not sure if I already sent the message below to you:</p>
<hr>
<p>I ensured that the composer.lock file was up to date, and added --debug<br>
to phpunit to see if it would give any additional hints:</p>
<p><a href="https://ci.appveyor.com/project/greg-1-anderson/output-formatters/builds/19655832">https://ci.appveyor.com/project/greg-1-anderson/output-formatters/b...</a></p>
<p>The --debug flag did not show any useful information. This same command<br>
with the same phpunit and composer versions works fine.</p>
<pre>
<code> - Greg</code>
</pre></div>Greg Andersontag:help.appveyor.com,2012-11-13:Comment/462930352018-10-21T02:08:20Z2018-10-21T02:08:22ZAppveyor stopped running my phpunit tests<div><p>OMG I FIXED IT!</p>
<p>By inspection I couldn't see any difference between my projects that<br>
were failing, and those that were working, so I tried doing a full diff<br>
of the appveyor.yml file, and found one notable difference:</p>
<p>--- appveyor.yml 2018-06-16 22:26:11.000000000 -0700 +++ ../annotated-command/appveyor.yml 2017-07-20 14:42:12.000000000 -0700 @@ -1,7 +1,7 @@ build: false -shallow_clone: false +shallow_clone: true platform: 'x86'</p>
<p>I switched 'shallow_clone:' to 'false' in my failing projects, and<br>
phpunit started working again.</p>
<p>I can think of no reason why making a shallow clone of the project would<br>
affect the behavior of phpunit. I don't even know why any of my projects<br>
had 'shallow_clone: true', as I don't need anything but the top commit<br>
to test any of these projects; I'm just glad that they did, or I don't<br>
know that I ever would have found this.</p>
<p>You may resolve this ticket; no further follow-up is required. You might<br>
wish to investigate further for your own edification, as in the past,<br>
'shallow_clone: true' worked for these projects.</p>
<p>Thanks,</p>
<pre>
<code> - Greg</code>
</pre></div>Greg Andersontag:help.appveyor.com,2012-11-13:Comment/462930352018-10-21T14:26:52Z2018-10-21T14:26:53ZAppveyor stopped running my phpunit tests<div><p>One last thought on this problem. My projects contain .gitattribute<br>
files with entries such as:</p>
<p>/tests export-ignore</p>
<p>If appveyor recently started to handle <code>shallow_clone: true</code> in a way<br>
that causes the resulting files to respect files with <code>export-ignore</code><br>
set, that would be incorrect behavior. Packagist respects export-ignore<br>
to remove files that are not needed for distribution (tests and other<br>
development files), which is why these attributes are set in my<br>
projects. A test tool should not do the same thing.</p>
<p>My opinion, anyway. The workaround is to not use the shallow_clone<br>
feature.</p>
<pre>
<code> - Greg</code>
</pre></div>Greg Andersontag:help.appveyor.com,2012-11-13:Comment/462930352018-10-23T17:11:16Z2018-10-23T17:11:16ZAppveyor stopped running my phpunit tests<div><p>I think it is expected behaviour that If <code>shallow_clone:</code> is set to true, the directories and files that are marked as <strong>export-ignore</strong> in the <code>.gitattributes</code> file will not be included in the clone.</p></div>Owen McDonnell