【问题标题】:Jenkins build multi-configuration project with MTAF not working on Sauce LabsJenkins 使用 MTAF 构建多配置项目,但无法在 Sauce Labs 上运行
【发布时间】:2013-05-03 18:49:15
【问题描述】:

我使用 Jenkins 和 Sauce Labs 配置了 Magento 测试自动化框架 (MTAF),一切运行良好。但是,在构建多配置项目时,我在 Jenkins 的作业配置中的浏览器列表中又选择了两个浏览器进行并行执行。

在构建时,它从 MTAF 配置文件 (browser.yaml) 中获取浏览器,而不是从 Jenkins 的作业配置中选择浏览器。

有没有办法从 Jenkins 中执行浏览器,而不是从 MTAF 的配置文件中执行?

【问题讨论】:

    标签: magento jenkins saucelabs mtaf multi-configuration


    【解决方案1】:

    MTAF 有 runtests.sh 脚本允许这样做。如果您想同时运行多个配置或浏览器,您可以将参数传递给脚本。传递参数使用下一个模板:

    runtests.sh application:browser, application:browser
    

    其中 application 是指向默认应用程序的链接名称(默认情况下:*mage)。

    你需要这样的命令:

    /path/to/script/runtests.sh mage:googlechrome, mage:firefox
    

    并在 Jenkins 配置中将其用作 phpunit 中的值。现在你有这样的东西:

    <target name="phpunit" description="Run unit tests with PHPUnit">
             <exec command="phpunit --configuration=${basedir}/tests/phpunit.xml
            --log-junit ${basedir}/build/logs/junit.xml
            --coverage-clover ${basedir}/build/logs/clover.xml
            --coverage-html ${basedir}/build/coverage"/>
    </target>
    

    更改为上面提供的命令,它应该可以解决问题。 最后,如果您想保留所有这些 phpunit 参数,请打开文件 runtests.sh,找到函数 runTest() 并更改行

    eval exec "/usr/bin/phpunit -c ${phpunitArr[${i}]}/phpunit.xml &"
    

    与您的 phpunit 参数一致:

    eval exec "/usr/bin/phpunit -c ${phpunitArr[${i}]}/phpunit.xml --log-junit /path/to/build/logs/junit.xml --coverage-clover /path/to/build/logs/clover.xml &"
    

    【讨论】:

      猜你喜欢
      • 2016-08-27
      • 2021-09-23
      • 2017-12-16
      • 2016-10-23
      • 2014-01-19
      • 2015-03-19
      • 2014-11-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多