【问题标题】:XCode TestPlan: specify which configuration to use from command lineXCode TestPlan:从命令行指定要使用的配置
【发布时间】:2021-10-14 00:28:48
【问题描述】:

我的XCode项目的测试计划中有一些配置,默认情况下,执行UI测试会执行所有配置,但是对于某些需求我需要在CI上根据某些条件排除一两个,我发现我可以指定要执行什么方案或测试计划,但是有没有办法从命令行指定要包含或排除的测试计划配置?谢谢!

【问题讨论】:

    标签: xcode xctestplan


    【解决方案1】:

    你可以像这样传递配置:

    $> xcodebuild test -workspace <path> 
                       -scheme <name> 
                       -destination <specifier>
                       -testPlan <name>
                       -only-test-configuration <configuration1> 
                       -only-test-configuration <configuration2>
                       ...
    

    或者跳过这样的配置:

    $> xcodebuild test -workspace <path> 
                       -scheme <name> 
                       -destination <specifier>
                       -testPlan <name>
                       -skip-test-configuration <configuration1> 
                       -skip-test-configuration <configuration2>
                       ...
    

    帮助页面中的相关行:

    $> xcodebuild -help
    Usage: xcodebuild ...
    Options:
        -workspace NAME                    build the workspace NAME
        -scheme NAME                       build the scheme NAME
        -destination DESTINATIONSPECIFIER  use the destination described by DESTINATIONSPECIFIER (a comma-separated set of key=value pairs describing the destination to use)
        -testPlan                          specifies the name of the test plan associated with the scheme to use for testing
        -only-test-configuration           constrains testing by specifying test configurations to include, and excluding other test configurations
        -skip-test-configuration           constrains testing by specifying test configurations to exclude, but including other test configurations
        ...
    

    【讨论】:

      猜你喜欢
      • 2014-10-18
      • 2018-05-16
      • 1970-01-01
      • 2017-09-11
      • 1970-01-01
      • 2015-07-22
      • 1970-01-01
      • 1970-01-01
      • 2018-11-05
      相关资源
      最近更新 更多