Codeception: The `bootstrap` command causes [Exception] Codeception is already installed in this directory

Created on 2 Nov 2018  路  3Comments  路  Source: Codeception/Codeception

What are you trying to achieve?

Perform the bootstrap command on a copied test directory which has a tests directory and a codeception.dist.yml file.

What do you get instead?

$ codecept bootstrap

  [Exception]
  Codeception is already installed in this directory

Details

  • Codeception version: 2.5.1
  • PHP Version: 7.2
  • Operating System: Windows 7 64bit
  • Installation type: Phar
  • Suite configuration: even an empty configuration file causes this error.

Question

Is this a bug or expected behavior? If it is by design, what about allowing it? It would be useful when it is needed to copy a tests directory in a working project area to a test server and perform bootstrap.

Most helpful comment

I would suggest keeping original files if exist and create missing required files. Or possibly add a command option -overwrite or something to overwrite those existent files.

At the moment, it seems even if a tests directory exists, the bootstrap command does not fail. Also acceptance.suite.dist.yml, functional.suite.dist.yml, unit.suite.dist.yml, _bootstrap.php can be placed prior to performing the command. But then, if codeception.dist.yml exists, it fails, which gave me an impression that the behavior is inconsistent.

All 3 comments

What do you expect bootstrap command to do if tests directory and codeception.yml file exists?

I would suggest keeping original files if exist and create missing required files. Or possibly add a command option -overwrite or something to overwrite those existent files.

At the moment, it seems even if a tests directory exists, the bootstrap command does not fail. Also acceptance.suite.dist.yml, functional.suite.dist.yml, unit.suite.dist.yml, _bootstrap.php can be placed prior to performing the command. But then, if codeception.dist.yml exists, it fails, which gave me an impression that the behavior is inconsistent.

I don't think that this is a bug.

Was this page helpful?
0 / 5 - 0 ratings