2016-07-11 2 views
0

내 조리법이 dynaTrace는 모듈을 설치하고 그것을 가능하게RSpec에이 손길이 닿지 않은 자원을 실패

it 'creates /opt/dynatrace/agent/lib64/libdtagent.so file' do 
    expect(chef_run).to render_file('/opt/dynatrace/agent/lib64/libdtagent.so') 
    end 

내가 RSpec을 실행은 다음과 같은 오류와 함께 실패하는 경우 :

$ rspec -f d ./spec/unit/recipes/apache_spec.rb[1:4] 

Run options: `include {:ids=>{"./spec/unit/recipes/apache_spec.rb"=>["1:4"]}}` 

dynatrace::apache 
    creates /opt/dynatrace/agent/lib64/libdtagent.so file (FAILED - 1) 

Failures: 

    1) dynatrace::apache creates /opt/dynatrace/agent/lib64/libdtagent.so file 
    Failure/Error: expect(chef_run).to render_file('/opt/dynatrace/agent/lib64/libdtagent.so') 
     expected Chef run to render "/opt/dynatrace/agent/lib64/libdtagent.so" 
    # ./spec/unit/recipes/apache_spec.rb:35:in `block (2 levels) in <top (required)>' 

Finished in 1.13 seconds (files took 8.93 seconds to load) 
1 example, 1 failure 

Failed examples: 

rspec ./spec/unit/recipes/apache_spec.rb:34 # dynatrace::apache creates /opt/dynatrace/agent/lib64/libdtagent.so file 


ChefSpec Coverage report generated... 

    Total Resources: 1 
    Touched Resources: 0 
    Touch Coverage: 0.0% 

Untouched Resources: 

    apache2_module[dtagent_module]  dynatrace/recipes/apache.rb:12 


ChefSpec Coverage report generated... 

    Total Resources: 1 
    Touched Resources: 0 
    Touch Coverage: 0.0% 

Untouched Resources: 

    apache2_module[dtagent_module]  dynatrace/recipes/apache.rb:12 

사양 오류의 원인을 확인하는 데 도움이 필요합니다.

답변

0

사용자의 설명에 따르면 문제가 그대로 유지되지 않아 문제가되지 않습니다. 요리사의 실행에는 자원이 https://github.com/Dynatrace/Dynatrace-Chef/blob/master/recipes/wsagent_package.rb의 모습에서 파일 /opt/dynatrace/agent/lib64/libdtagent.so

을 생성하지 않기 때문에

귀하의 chefspec 실행이 실패한 레시피 아카이브/타르의 추출을 통해 해당 파일을 만들 수 있습니다 포함된다. 이것은 부작용이므로 단위 테스트를 사용하여 직접 테스트 할 수 없습니다.

두 가지 기능을 함께 묶는 래퍼 요리 책을 쓰는 것 같습니다.

서버 사양이있는 테스트 키친과 같은 도구는 작성중인 통합 테스트에 더 적합 할 수 있습니다.

관련 문제