lundi 28 septembre 2015

Codeception won't build modules configured in global config

I have this in my codeception.yml in tests root folder config:

include:
  - codeception/backend
  - codeception/common
  - codeception/console

paths:
  log: codeception/_output

settings:
  colors: true

modules:
    enabled:
      - Db
    config:
        Db:
            dsn: 'mysql:host=localhost;dbname=db1_test'
            user: 'root'
            password: 'qwerty'
            cleanup: true

And then this in my codeception/unit.suite.yml:

class_name: UnitTester
modules:
    enabled:
      - Db

But I get the following error when I run codecept build from tests root folder:

[Codeception\Exception\ModuleConfigException]                     
  Db module is not configured!                                      

  Options: dsn, user, password are required                         
  Please, update the configuration and set all the required fields

If I remove - Db from codeception/unit.suite.yml the module just doesn't run at all. It seems like global config's modules section is ignored completely. It won't even affect anything if there is a typo in Db in global config. But I need to have only one config for Db for each suite and each application. What am I doing wrong? Documentation says it should be possible to declare modules globally.

Aucun commentaire:

Enregistrer un commentaire