Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
e6c108e9
Commit
e6c108e9
authored
10 years ago
by
Michael Lumish
Browse files
Options
Downloads
Plain Diff
Merge pull request #1119 from tbetbetbe/grpc_ruby_update_rakefile
Updates the Rakefile
parents
7bca47e0
f20d7609
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ruby/Rakefile
+27
-26
27 additions, 26 deletions
src/ruby/Rakefile
with
27 additions
and
26 deletions
src/ruby/Rakefile
+
27
−
26
View file @
e6c108e9
...
@@ -2,14 +2,17 @@
...
@@ -2,14 +2,17 @@
require
'rake/extensiontask'
require
'rake/extensiontask'
require
'rspec/core/rake_task'
require
'rspec/core/rake_task'
require
'rubocop/rake_task'
require
'rubocop/rake_task'
require
'bundler/gem_tasks'
desc
'Run R
ubocop
to
check
for style violations'
# Add r
ubocop
style
check
ing tasks
RuboCop
::
RakeTask
.
new
RuboCop
::
RakeTask
.
new
# Add the extension compiler task
Rake
::
ExtensionTask
.
new
'grpc'
do
|
ext
|
Rake
::
ExtensionTask
.
new
'grpc'
do
|
ext
|
ext
.
lib_dir
=
File
.
join
(
'lib'
,
'grpc'
)
ext
.
lib_dir
=
File
.
join
(
'lib'
,
'grpc'
)
end
end
# Define the test suites
SPEC_SUITES
=
[
SPEC_SUITES
=
[
{
id: :wrapper
,
title:
'wrapper layer'
,
files:
%w(spec/*.rb)
},
{
id: :wrapper
,
title:
'wrapper layer'
,
files:
%w(spec/*.rb)
},
{
id: :idiomatic
,
title:
'idiomatic layer'
,
dir:
%w(spec/generic)
,
{
id: :idiomatic
,
title:
'idiomatic layer'
,
dir:
%w(spec/generic)
,
...
@@ -19,36 +22,34 @@ SPEC_SUITES = [
...
@@ -19,36 +22,34 @@ SPEC_SUITES = [
{
id: :server
,
title:
'rpc server thread tests'
,
dir:
%w(spec/generic)
,
{
id: :server
,
title:
'rpc server thread tests'
,
dir:
%w(spec/generic)
,
tag:
'server'
}
tag:
'server'
}
]
]
namespace
:suite
do
SPEC_SUITES
.
each
do
|
suite
|
desc
"Run all specs in the
#{
suite
[
:title
]
}
spec suite"
RSpec
::
Core
::
RakeTask
.
new
(
suite
[
:id
])
do
|
t
|
spec_files
=
[]
suite
[
:files
].
each
{
|
f
|
spec_files
+=
Dir
[
f
]
}
if
suite
[
:files
]
if
suite
[
:dir
]
suite
[
:dir
].
each
{
|
f
|
spec_files
+=
Dir
[
"
#{
f
}
/**/*_spec.rb"
]
}
end
helper
=
'spec/spec_helper.rb'
spec_files
<<
helper
unless
spec_files
.
include?
(
helper
)
desc
'Run all RSpec tests'
t
.
pattern
=
spec_files
namespace
:spec
do
t
.
rspec_opts
=
"--tag
#{
suite
[
:tag
]
}
"
if
suite
[
:tag
]
namespace
:suite
do
if
suite
[
:tags
]
SPEC_SUITES
.
each
do
|
suite
|
t
.
rspec_opts
=
suite
[
:tags
].
map
{
|
x
|
"--tag
#{
x
}
"
}.
join
(
' '
)
desc
"Run all specs in
#{
suite
[
:title
]
}
spec suite"
RSpec
::
Core
::
RakeTask
.
new
(
suite
[
:id
])
do
|
t
|
spec_files
=
[]
suite
[
:files
].
each
{
|
f
|
spec_files
+=
Dir
[
f
]
}
if
suite
[
:files
]
if
suite
[
:dirs
]
suite
[
:dirs
].
each
{
|
f
|
spec_files
+=
Dir
[
"
#{
f
}
/**/*_spec.rb"
]
}
end
t
.
pattern
=
spec_files
t
.
rspec_opts
=
"--tag
#{
suite
[
:tag
]
}
"
if
suite
[
:tag
]
if
suite
[
:tags
]
t
.
rspec_opts
=
suite
[
:tags
].
map
{
|
x
|
"--tag
#{
x
}
"
}.
join
(
' '
)
end
end
end
end
end
end
end
end
end
desc
'Compiles the extension then runs all the tests'
# Define dependencies between the suites.
task
:all
task
'suite:wrapper'
=>
[
:compile
,
:rubocop
]
task
'suite:idiomatic'
=>
'suite:wrapper'
task
'suite:bidi'
=>
'suite:wrapper'
task
'suite:server'
=>
'suite:wrapper'
desc
'Compiles the gRPC extension then runs all the tests'
task
all:
[
'suite:idiomatic'
,
'suite:bidi'
,
'suite:server'
]
task
default: :all
task
default: :all
task
'spec:suite:wrapper'
=>
[
:compile
,
:rubocop
]
task
'spec:suite:idiomatic'
=>
'spec:suite:wrapper'
task
'spec:suite:bidi'
=>
'spec:suite:wrapper'
task
'spec:suite:server'
=>
'spec:suite:wrapper'
task
all:
[
'spec:suite:idiomatic'
,
'spec:suite:bidi'
,
'spec:suite:server'
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment