Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
bbbc634e
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bbbc634e
编写于
9月 04, 2017
作者:
M
Matthew Draper
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Split railties suite in half
上级
56202d8d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
81 addition
and
58 deletion
+81
-58
.travis.yml
.travis.yml
+2
-1
ci/travis.rb
ci/travis.rb
+7
-2
railties/Rakefile
railties/Rakefile
+72
-55
未找到文件。
.travis.yml
浏览文件 @
bbbc634e
...
...
@@ -41,7 +41,8 @@ env:
global
:
-
"
JRUBY_OPTS='--dev
-J-Xmx1024M'"
matrix
:
-
"
GEM=railties"
-
"
GEM=railties:1"
-
"
GEM=railties:2"
-
"
GEM=ap,ac"
-
"
GEM=am,amo,as,av,aj,ast"
-
"
GEM=as
PRESERVE_TIMEZONES=1"
...
...
ci/travis.rb
浏览文件 @
bbbc634e
...
...
@@ -78,10 +78,15 @@ def tasks
end
tasks
else
[
"test"
,
(
"isolated"
if
isolated?
),
(
"integration"
if
integration?
),
(
"ujs"
if
ujs?
)].
compact
.
join
(
":"
)
[
"test"
,
(
"isolated"
if
isolated?
),
(
"integration"
if
integration?
),
(
"ujs"
if
ujs?
)
,
subset
].
compact
.
join
(
":"
)
end
end
def
subset
n
=
component
.
split
(
":"
).
last
n
if
n
=~
/\A\d+\z/
end
def
key
key
=
[
gem
]
key
<<
adapter
if
activerecord?
...
...
@@ -166,7 +171,7 @@ def run_bug_report_templates
next
if
gem
==
"av:ujs"
&&
isolated
next
if
gem
==
"guides"
&&
isolated
next
if
gem
=~
/:integration/
&&
isolated
next
if
gem
=
=
"railties"
&&
isolated
next
if
gem
=
~
/railties:/
&&
isolated
build
=
Build
.
new
(
gem
,
isolated:
isolated
)
failures
<<
build
.
key
unless
build
.
run!
...
...
railties/Rakefile
浏览文件 @
bbbc634e
...
...
@@ -9,64 +9,81 @@ task :package
desc
"Run all unit tests"
task
test:
"test:isolated"
namespace
:test
do
task
:isolated
do
dash_i
=
[
"test"
,
"lib"
,
"../activesupport/lib"
,
"../actionpack/lib"
,
"../actionview/lib"
,
"../activemodel/lib"
].
map
{
|
dir
|
File
.
expand_path
(
dir
,
__dir__
)
}
dash_i
.
reverse_each
do
|
x
|
$:
.
unshift
(
x
)
unless
$:
.
include?
(
x
)
end
$-w
=
true
require
"bundler/setup"
unless
defined?
(
Bundler
)
require
"active_support"
failing_files
=
[]
dirs
=
(
ENV
[
"TEST_DIR"
]
||
ENV
[
"TEST_DIRS"
]
||
"**"
).
split
(
","
)
test_files
=
dirs
.
map
{
|
dir
|
"test/
#{
dir
}
/*_test.rb"
}
Dir
[
*
test_files
].
each
do
|
file
|
next
true
if
file
.
start_with?
(
"test/fixtures/"
)
fake_command
=
Shellwords
.
join
([
FileUtils
::
RUBY
,
"-w"
,
*
dash_i
.
map
{
|
dir
|
"-I
#{
Pathname
.
new
(
dir
).
relative_path_from
(
Pathname
.
pwd
)
}
"
},
file
,
])
puts
fake_command
# We could run these in parallel, but pretty much all of the
# railties tests already run in parallel, so ¯\_(⊙︿⊙)_/¯
Process
.
waitpid
fork
{
ARGV
.
clear
Rake
.
application
=
nil
load
file
}
unless
$?
.
success?
failing_files
<<
file
end
end
run_isolated_tests
=
lambda
do
|
files
|
dash_i
=
[
"test"
,
"lib"
,
"../activesupport/lib"
,
"../actionpack/lib"
,
"../actionview/lib"
,
"../activemodel/lib"
].
map
{
|
dir
|
File
.
expand_path
(
dir
,
__dir__
)
}
dash_i
.
reverse_each
do
|
x
|
$:
.
unshift
(
x
)
unless
$:
.
include?
(
x
)
end
$-w
=
true
require
"bundler/setup"
unless
defined?
(
Bundler
)
require
"active_support"
unless
failing_files
.
empty?
puts
puts
"Failed in:"
failing_files
.
each
do
|
file
|
puts
"
#{
file
}
"
end
puts
failing_files
=
files
.
reject
do
|
file
|
next
true
if
file
.
start_with?
(
"test/fixtures/"
)
raise
"Failure in isolated test runner"
fake_command
=
Shellwords
.
join
([
FileUtils
::
RUBY
,
"-w"
,
*
dash_i
.
map
{
|
dir
|
"-I
#{
Pathname
.
new
(
dir
).
relative_path_from
(
Pathname
.
pwd
)
}
"
},
file
,
])
puts
fake_command
# We could run these in parallel, but pretty much all of the
# railties tests already run in parallel, so ¯\_(⊙︿⊙)_/¯
Process
.
waitpid
fork
{
ARGV
.
clear
Rake
.
application
=
nil
load
file
}
$?
.
success?
end
unless
failing_files
.
empty?
puts
puts
"Failed in:"
failing_files
.
each
do
|
file
|
puts
"
#{
file
}
"
end
puts
raise
"Failure in isolated test runner"
end
end
_test_files
=
nil
test_files
=
lambda
do
_test_files
||=
Dir
[
*
(
ENV
[
"TEST_DIR"
]
||
ENV
[
"TEST_DIRS"
]
||
"**"
).
split
(
","
).
map
{
|
dir
|
"test/
#{
dir
}
/*_test.rb"
}
]
end
split_filter
=
lambda
{
|
file
|
file
=~
/test\/application\//
}
namespace
:test
do
task
"1"
do
run_isolated_tests
.
call
test_files
.
call
.
select
(
&
split_filter
)
end
task
"2"
do
run_isolated_tests
.
call
test_files
.
call
.
reject
(
&
split_filter
)
end
task
:isolated
do
run_isolated_tests
.
call
test_files
.
call
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录