Search code examples
phpphpunitappveyor

Appveyor (with phpunit) fails: "The batch file cannot be found"


I have a git repository (it's a cakephp plugin) with this appveyor branch and this appveyor.yml config file.

The build fails (log), but, as you can see, all the tests are performed correctly. The build exits with:

OK (21 tests, 103 assertions)
The batch file cannot be found.
Command exited with code 1

Yet the test_script commands

  - cd C:\projects\me-cms-instagram
  - vendor\bin\phpunit.bat

are executed correctly, otherwise the phpunit tests would not be successful.

What could be the problem? With a web search I do not get results. Thanks.


edit: log link was wrong.


Solution

  • The error message you're seeing:

    "The batch file cannot be found."

    is by the operating system you make use of via Appveyor, which is a Windows operating system.

    To no go too much into detail: This message is given when a batch file (.bat) that currently runs has been deleted between it's start and the time the error message is shown.

    You can solve that by making your test-suite not deleting that file. Windows is not Linux.

    If you can't do so, invoke Phpunit directly and not via that batch file.

    For more details please consult the windows operation system manual and development guide for the windows operating system. Additionally Appveyor should offer you also some support options.

    References: