2012-10-19 13 views
2

我黃瓜測試工作以及在命令行上,但是當我在詹金斯/ Hudson持續集成運行它們,我得到以下,但我不知道如何解決它:雖然測試通過了,爲什麼黃瓜繼續在詹金斯上令人失望?

11 scenarios (3 skipped, 3 pending, 5 passed) 
78 steps (51 skipped, 3 pending, 24 passed) 
0m3.238s 
Build step 'Execute shell' marked build as failure 
Recording test results 
Failed to send e-mail to kamilski81 because no e-mail address is known, and no default e-mail domain is configured 
Failed to send e-mail to i.wooten because no e-mail address is known, and no default e-mail domain is configured 
Failed to send e-mail to scott.j.rodgers because no e-mail address is known, and no default e-mail domain is configured 
Sending e-mails to: [email protected] 
Finished: FAILURE 

我的我的腳本的最後幾行:

cucumber 

我建議添加「退出0」,但這會打破我的Junit報告,因此報告不正確。

+0

該消息表示您的「Execute shell」步驟失敗。除非您提供更多信息,例如該步驟的內容,否則我們無法幫助您。 –

+0

這是非常有趣的,因爲我在工作中使用黃瓜,我們也有同樣的問題;測試在本地運行良好,但當由Jenkins在帶有Firefox驅動程序的從站上運行時,我們會遇到零星的故障。 –

回答

4

我覺得黃瓜給出了非零的進程退出代碼,因爲跳過或因爲未決測試。嘗試讓它不運行任何跳過,然後任何掛起,然後任何跳過或待定測試,看看它給出了什麼退出代碼。

cucumber ...args to select tests... ; echo $?

4

--strict標誌導致黃瓜返回退出代碼1(例如失敗)當有一個未決的場景黃瓜:要查看退出代碼(在UNIX中),喜歡的東西運行。如果有非零退出代碼,Jenkins(或任何CI)將會失敗。

我會檢查你的項目中是否有一個cucumber.yml文件,因爲這可能是你的--strict隱藏的地方。

+1

謝謝。檢查cucumber.yml的提示非常有幫助。 FWIW,我從'cucumber.yml'中刪除'--strict'並添加了一個新的配置文件'ci','ci:<%= std_opts%> features',其中不包含'--strict'(手動添加到其他配置文件對我來說是有意義的)。這讓我在我使用的CI服務上使用'cucumber -p ci'。 – mczepiel