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 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.
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.
I switched 'shallow_clone:' to 'false' in my failing projects, and
phpunit started working again.
I can think of no reason why making a shallow clone of the project would
affect the behavior of phpunit. I don't even know why any of my projects
had 'shallow_clone: true', as I don't need anything but the top commit
to test any of these projects; I'm just glad that they did, or I don't
know that I ever would have found this.
You may resolve this ticket; no further follow-up is required. You might
wish to investigate further for your own edification, as in the past,
'shallow_clone: true' worked for these projects.
on 21 Oct, 2018 02:26 PM
One last thought on this problem. My projects contain .gitattribute
files with entries such as:
If appveyor recently started to handle `shallow_clone: true` in a way
that causes the resulting files to respect files with `export-ignore`
set, that would be incorrect behavior. Packagist respects export-ignore
to remove files that are not needed for distribution (tests and other
development files), which is why these attributes are set in my
projects. A test tool should not do the same thing.
My opinion, anyway. The workaround is to not use the shallow_clone