【发布时间】:2019-04-18 00:14:18
【问题描述】:
我刚刚开始使用 HerokuCI。我有一些 Selenium 测试,所以我在 app.json 中添加了构建包。
{
"buildpacks": [
{ "url": "heroku/ruby" }
],
"environments": {
"test": {
"addons": ["heroku-postgresql:in-dyno", "heroku-redis:in-dyno"],
"buildpacks": [
{ "url": "heroku/ruby" },
{ "url": "https://github.com/notvad/heroku-buildpack-selenium" },
{ "url": "https://github.com/heroku/heroku-buildpack-chromedriver" },
{ "url": "https://github.com/heroku/heroku-buildpack-google-chrome" }
],
"env": {
"REDIS_PROVIDER": "REDIS_URL",
"RAILS_ENV": "test",
"RACK_ENV": "test",
"MALLOC_ARENA_MAX": 2,
"LANG": "en_US.UTF-8",
"TEST_API": 1
},
"scripts": {
"test-setup": "./bin/setup-cc-test-reporter",
"test": "./bin/test-with-cc-test-reporter"
}
}
}
}
这些与所有依赖项一起不断重建。
-----> Selenium app detected
bash: /tmp/buildpacks/b5ae60a477f2ba582d00a4ba23348059d40dea69cea6d982947f7c6afa72d2b8d69252449d43cbcf97a23341fd57300a3fef3224ace95482e1c0deaf8a844e4d/export: No such file or directory
bash: /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/export: No such file or directory
-----> Updating apt caches
Hit:1 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Reading package lists...
-----> Fetching .debs for xserver-xorg-core libgl1-mesa-dri xvfb libglide3 xfs unzip
Reading package lists...
Building dependency tree...
Package xfs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'xfs' has no installation candidate
-----> Installing adwaita-icon-theme_3.28.0-1ubuntu1_all.deb
-----> Installing at-spi2-core_2.28.0-1_amd64.deb
...and so on...
-----> Downloading and installing Selenium
-----> Writing profile script
-----> chromedriver app detected
bash: /tmp/buildpacks/b5ae60a477f2ba582d00a4ba23348059d40dea69cea6d982947f7c6afa72d2b8d69252449d43cbcf97a23341fd57300a3fef3224ace95482e1c0deaf8a844e4d/export: No such file or directory
bash: /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/export: No such file or directory
bash: /tmp/buildpacks/f55d0db8af2b8c70f2c0e028ef5430955852d9e4f07a06e333e54eb5264a81b9d1e77d1cc02851b4c7da30f6da47b13959e18a24c630212b899920d05f32a566/export: No such file or directory
-----> Looking up latest chromedriver version...
-----> Downloading chromedriver v2.43...
Archive: /tmp/chromedriver.zip
inflating: /app/.chromedriver/bin/chromedriver
-----> Creating chromedriver export scripts...
-----> Google Chrome app detected
bash: /tmp/buildpacks/b5ae60a477f2ba582d00a4ba23348059d40dea69cea6d982947f7c6afa72d2b8d69252449d43cbcf97a23341fd57300a3fef3224ace95482e1c0deaf8a844e4d/export: No such file or directory
bash: /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/export: No such file or directory
bash: /tmp/buildpacks/f55d0db8af2b8c70f2c0e028ef5430955852d9e4f07a06e333e54eb5264a81b9d1e77d1cc02851b4c7da30f6da47b13959e18a24c630212b899920d05f32a566/export: No such file or directory
bash: /tmp/buildpacks/27353aa3b5edb2f8361186206e863f5d481f02805d02f0efdec439f3d30349a4fbdad2951af33a0492023fb0d90d26dafda6fe76f1b2d34f68564a98545f7022/export: No such file or directory
-----> Installing Google Chrome from the stable channel.
-----> Updating apt caches
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Reading package lists...
-----> Fetching .debs for gconf-service
...and so on...
这占用了大部分测试运行时间。
可以缓存这些安装吗?
【问题讨论】:
-
你用什么 CLI 来启动进程?
-
@Bsquare 对不起,我不确定我明白你在问什么。
-
我的意思是,你启动什么命令来获得这种行为?
-
@Bsquare 我没有直接控制权。它是作为 Heroku 提供的 Github PR hook 启动的。我不直接控制配置 CI dyno。相反,它是通过指定buildpacks in a configuration file。见devcenter.heroku.com/articles/…
-
好的,我来分析一下;)
标签: heroku buildpack heroku-ci