我試圖跑過來到位桶平臺具有以下配置測試:角2個CLI上到位桶管道運行測試
image: node:6.8.0
pipelines:
default:
- step:
script:
- echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
- ln -sf /usr/bin/xvfb-chrome /usr/bin/google-chrome
- npm --version
- npm install
- npm test
這就是輸出:
> ng test
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
13 10 2016 15:26:57.937:WARN [karma]: No captured browser, open http://localhost:9876/
WARNING in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
45:15 Critical dependency: the request of a dependency is an expression
WARNING in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
57:15 Critical dependency: the request of a dependency is an expression
13 10 2016 15:26:57.945:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/
13 10 2016 15:26:57.946:INFO [launcher]: Launching browser Chrome with unlimited concurrency
13 10 2016 15:26:58.033:INFO [launcher]: Starting browser Chrome
13 10 2016 15:26:58.421:ERROR [launcher]: Cannot start Chrome
13 10 2016 15:26:58.532:INFO [launcher]: Trying to start Chrome again (1/2).
13 10 2016 15:26:58.813:ERROR [launcher]: Cannot start Chrome
13 10 2016 15:26:58.814:INFO [launcher]: Trying to start Chrome again (2/2).
13 10 2016 15:26:59.049:ERROR [launcher]: Cannot start Chrome
13 10 2016 15:26:59.050:ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up.
的問題是因果報應無法啓動Chrome瀏覽器。我認爲問題發生在任何碼頭環境中。 如何在bitbucket管道中運行測試?
請使用像PhantomJS這樣的無頭瀏覽器嗎? – jonrsharpe
不,請使用karma和proactor的角度cli默認配置。有沒有使用鉻的可能性,或者我必須使用幻影? – Serginho
你特別*想要*使用非無頭瀏覽器嗎? Chrome是Angular CLI項目的默認設置,但切換到Phantom並不重要(例如,請參閱我的項目https://github.com/textbook/known-for-web)。或者,你是否看過像醬汁實驗室或安裝例如xvfb的?對於bitbucket管道來說,這似乎不是特別的,我會提出一些更廣泛的研究。 – jonrsharpe