2017-02-10 8 views
0

테스트를 거친 이미지를 S3에 업로드하는 테스트가 있습니다. 요청을 스텁했기 때문입니다.WebMock을 사용하는 서클 CI에서만 amazon S3 업로드가 실패합니다.

모든 테스트는 로컬 통과하지만 원 CI에 나는 다음과 같은 예외 얻을 :

WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: GET http://169.254.169.254/latest/meta-data/iam/security-credentials/ with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Ruby'} 

You can stub this request with the following snippet: 

stub_request(:get, "http://169.254.169.254/latest/meta-data/iam/security-credentials/"). 
    with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Ruby'}). 
    to_return(:status => 200, :body => "", :headers => {}) 

답변

0

나는 ENV는 CI

에 AWS_ID 및 AWS_SECRET 설정 바르하지 않았다 때문이었다을