Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
2157016f
H
hub
项目概览
github
/
hub
9 个月 前同步成功
通知
3
Star
22523
Fork
2406
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2157016f
编写于
8月 22, 2019
作者:
M
Mislav Marohnić
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Speed up setting environment variables in Aruba
上级
ce5d8858
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
45 addition
and
42 deletion
+45
-42
features/support/env.rb
features/support/env.rb
+45
-42
未找到文件。
features/support/env.rb
浏览文件 @
2157016f
...
...
@@ -9,50 +9,53 @@ hub_dir = Dir.mktmpdir('hub_build')
raise
'hub build failed'
unless
system
(
"./script/build -o
#{
hub_dir
}
/hub"
)
Before
do
# speed up load time by skipping RubyGems
set_environment_variable
'RUBYOPT'
,
'--disable-gems'
if
RUBY_VERSION
>
'1.9'
# put fakebin on the PATH
set_environment_variable
'PATH'
,
"
#{
hub_dir
}
:
#{
bin_dir
}
:
#{
ENV
[
'PATH'
]
}
"
# clear out GIT if it happens to be set
set_environment_variable
'GIT'
,
nil
# exclude this project's git directory from use in testing
set_environment_variable
'GIT_CEILING_DIRECTORIES'
,
File
.
expand_path
(
'../../..'
,
__FILE__
)
# sabotage git commands that might try to access a remote host
set_environment_variable
'GIT_PROXY_COMMAND'
,
'echo'
# avoids reading from current user's "~/.gitconfig"
set_environment_variable
'HOME'
,
expand_path
(
'home'
)
set_environment_variable
'TMPDIR'
,
expand_path
(
'tmp'
)
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
set_environment_variable
'XDG_CONFIG_HOME'
,
nil
set_environment_variable
'XDG_CONFIG_DIRS'
,
nil
# used in fakebin/git
set_environment_variable
'HUB_SYSTEM_GIT'
,
system_git
# ensure that api.github.com is actually never hit in tests
set_environment_variable
'HUB_TEST_HOST'
,
'http://127.0.0.1:0'
# ensure we use fakebin `open` to test browsing
set_environment_variable
'BROWSER'
,
'open'
# sabotage opening a commit message editor interactively
set_environment_variable
'GIT_EDITOR'
,
'false'
# reset current localization settings
set_environment_variable
'LANG'
,
nil
set_environment_variable
'LANGUAGE'
,
nil
set_environment_variable
'LC_ALL'
,
'en_US.UTF-8'
# ignore current user's token
set_environment_variable
'GITHUB_TOKEN'
,
nil
set_environment_variable
'GITHUB_USER'
,
nil
set_environment_variable
'GITHUB_PASSWORD'
,
nil
set_environment_variable
'GITHUB_HOST'
,
nil
author_name
=
"Hub"
author_email
=
"hub@test.local"
set_environment_variable
'GIT_AUTHOR_NAME'
,
author_name
set_environment_variable
'GIT_COMMITTER_NAME'
,
author_name
set_environment_variable
'GIT_AUTHOR_EMAIL'
,
author_email
set_environment_variable
'GIT_COMMITTER_EMAIL'
,
author_email
set_environment_variable
'HUB_VERSION'
,
'dev'
set_environment_variable
'HUB_REPORT_CRASH'
,
'never'
set_environment_variable
'HUB_PROTOCOL'
,
nil
aruba
.
environment
.
update
(
# speed up load time by skipping RubyGems
'RUBYOPT'
=>
'--disable-gems'
,
# put fakebin on the PATH
'PATH'
=>
"
#{
hub_dir
}
:
#{
bin_dir
}
:
#{
ENV
[
'PATH'
]
}
"
,
# clear out GIT if it happens to be set
'GIT'
=>
nil
,
# exclude this project's git directory from use in testing
'GIT_CEILING_DIRECTORIES'
=>
File
.
expand_path
(
'../../..'
,
__FILE__
),
# sabotage git commands that might try to access a remote host
'GIT_PROXY_COMMAND'
=>
'echo'
,
# avoids reading from current user's "~/.gitconfig"
'HOME'
=>
expand_path
(
'home'
),
'TMPDIR'
=>
expand_path
(
'tmp'
),
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
'XDG_CONFIG_HOME'
=>
nil
,
'XDG_CONFIG_DIRS'
=>
nil
,
# used in fakebin/git
'HUB_SYSTEM_GIT'
=>
system_git
,
# ensure that api.github.com is actually never hit in tests
'HUB_TEST_HOST'
=>
'http://127.0.0.1:0'
,
# ensure we use fakebin `open` to test browsing
'BROWSER'
=>
'open'
,
# sabotage opening a commit message editor interactively
'GIT_EDITOR'
=>
'false'
,
# reset current localization settings
'LANG'
=>
nil
,
'LANGUAGE'
=>
nil
,
'LC_ALL'
=>
'en_US.UTF-8'
,
# ignore current user's token
'GITHUB_TOKEN'
=>
nil
,
'GITHUB_USER'
=>
nil
,
'GITHUB_PASSWORD'
=>
nil
,
'GITHUB_HOST'
=>
nil
,
'GIT_AUTHOR_NAME'
=>
author_name
,
'GIT_COMMITTER_NAME'
=>
author_name
,
'GIT_AUTHOR_EMAIL'
=>
author_email
,
'GIT_COMMITTER_EMAIL'
=>
author_email
,
'HUB_VERSION'
=>
'dev'
,
'HUB_REPORT_CRASH'
=>
'never'
,
'HUB_PROTOCOL'
=>
nil
,
)
FileUtils
.
mkdir_p
(
expand_path
(
'~'
))
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录