[英]'serenity-bdd run' gives 'The “path” argument must be of type string' error in Docker
我有一個在命令行上正常運行的 Serenity-JS 項目。 I am trying to package it into a Docker container for use in an Azure pipeline, which is a model we've used with other projects.
但是,當我通過 Docker 運行項目時,測試正確執行,但生成報告文檔的步驟失敗並出現一個相當簡潔的錯誤:
[test:report] > serenity-bdd run
[test:report]
[test:report] I'm terribly sorry, but something didn't go according to plan:
[test:report] The "path" argument must be of type string. Received null
output 中沒有其他內容,因此問題的根源尚不清楚。 我什至不確定這是指哪個path
參數。 我已經深入研究了 Serenity-JS 節點模塊,但我在這里沒有看到明顯的罪魁禍首,我也不明白為什么它可以通過命令行工作,但不能在 Docker 中工作。 任何見解將不勝感激。 謝謝!
簡短的修復
安裝Java開發包-JDK
快捷方式:
在 Windows 與 Chocolatey
巧克力安裝jdk8
在 Unix 或 Max
安裝jdk8
簡單的方法:
閱讀並遵循 Serenity BDD 安裝指南。 https://serenity-bdd.github.io/theserenitybook/latest/first-steps.html
我嘗試安裝較新的openjdk
,例如 11 或 16,但這給了我關於 Windows 的問題。
原因:
serenity-js 無法啟動 serenity-bdd java 模塊,因為它找不到 Java。
如果以后有人遇到這個問題,我找到了解決方案:我使用的基本映像沒有 Java 運行時, serenity-bdd
在后台使用它。 切換到openjdk
基礎映像並手動安裝我的 Node 依賴項解決了這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.