代码之家  ›  专栏  ›  技术社区  ›  MisterStrickland

Chef警告ChefSpec的平台和版本运行覆盖率

  •  0
  • MisterStrickland  · 技术社区  · 7 年前

    Coverage 使用 spec_helper.rb 文件如下:

    require 'chefspec'
    require 'chefspec/berkshelf'
    
    ChefSpec::Coverage.start! do
      add_output do |reportOutput|
        File.open( "coverage.json","w" ) do |f| 
          f.puts(reportOutput[:total])
          f.puts(reportOutput[:touched])
          f.puts(reportOutput[:coverage])
          f.puts(reportOutput[:untouched_resources])
          f.puts(reportOutput[:all_resources])
        end 
      end 
    end
    

    rspec

    WARNING: you must specify a 'platform' and 'version' to your ChefSpec 
    Runner and/or Fauxhai constructor, in the future omitting these will 
    become a hard error. A list of available platforms is available at 
    https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md
    .WARNING: you must specify a 'platform' and 'version' to your ChefSpec
    Runner and/or Fauxhai constructor, in the future omitting these will 
    become a hard error. A list of available platforms is available at 
    https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md
    

    我不确定如何在中指定平台和版本 新闻报道 ChefSpec::ServerRunner.new()

    1 回复  |  直到 7 年前
        1
  •  1
  •   coderanger    7 年前

    你没有显示你的规格,所以我不能具体说,但你必须通过 platform version ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04')