是否有可能将Codeception的功能/接受配置URL存储在仓库之外? [英] Is it possible to store Functional/Acceptance config URL of Codeception outside repository?

查看:149
本文介绍了是否有可能将Codeception的功能/接受配置URL存储在仓库之外?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Codeception的PHP项目,其中有几个开发人员在工作。每个人都有自己的环境和不同的URL到他们的项目副本。但是在Codeception Functional / Acceptance yml配置文件中,我们必须设置验收和功能测试的URL。

我们怎样才能有不同的URL到项目中,并在存储库中拥有主要的配置部分?
预先感谢您。

解决方案

我有同样的问题。我在这里问了相同的问题。我使用 - environment 选项来实现这个功能。



这里是示例配置:

  class_name:FunctionalTester 
模块:
启用:
#在此处添加框架模块
- Yii1
- \Helper\Functional
- PhpBrowser
- Db
config:
Yii1:
appPath:'/Volumes/disk0s4/www/new-proj/trunk/test.php'
url:'https://my.proj.local /test.php'
PhpBrowser:
url:'https://my.proj.didin/'
Db:
dsn:'mysql:host = 127.0.0.1; dbname = test-proj-new'
user''root'
密码:'root'
env:
my_env:
modules:
enabled:
- Yii1
- \Helper\Functional
config:
Yii1:
appPath:'我的环境的index.php的路径'
url:'http://my.local/test.php'
production_env:
模块:
启用:
- Yii1
- \Helper\Functional
config:
Yii1:
appPath:'生产环境的index.php的路径'
url:'http://my.local.com/test.php'

我知道config包含重复行,应该可以简化,我试图简化通过删除全局 modules 中的重复行,但似乎不适用于我。

所以我让你看到上面的配置,并且创建了问题,但仍然怀疑是否有人得到这个覆盖工作。



我希望这对任何人都有帮助。


I have a PHP project with Codeception on which several developers are working. Everyone have their own environment and different URL to their copy of the project. But in Codeception Functional/Acceptance yml config file we have to set up URL for acceptance and functional tests.

How could we have different URL to project and have main part of configs in repository? Thank you in advance.

解决方案

I have same problem. I asked same question here. I used --environment option to get this working.

here is the example configuration:

class_name: FunctionalTester
modules:
    enabled:
        # add framework module here
        - Yii1
        - \Helper\Functional
        - PhpBrowser
        - Db
    config:
        Yii1:
            appPath: '/Volumes/disk0s4/www/new-proj/trunk/test.php'
            url: 'https://my.proj.local/test.php'
        PhpBrowser:
            url: 'https://my.proj.didin/'
        Db:
            dsn: 'mysql:host=127.0.0.1;dbname=test-proj-new'
            user: 'root'
            password: 'root'
env:
    my_env:
       modules:
            enabled:
                - Yii1
                - \Helper\Functional
            config:
                Yii1:
                     appPath: 'path to index.php of my environment'
                     url: 'http://my.local/test.php'
    production_env:
       modules:
            enabled:
                - Yii1
                - \Helper\Functional
            config:
                Yii1:
                     appPath: 'path to index.php of production environment'
                     url: 'http://my.local.com/test.php'

I know that config contains duplicated-lines and should be able to be simplified, I've tried to simplify by removing duplicate line at global modules, but seems doesn't work to me.

So I let the config as you see above and I have created Issue for it, but still wondering if someone get this overriding working.

I hope this helps to anyone.

这篇关于是否有可能将Codeception的功能/接受配置URL存储在仓库之外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆