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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
a3e244f2
Commit
a3e244f2
authored
Sep 22, 2015
by
murgatroid99
Browse files
Options
Downloads
Patches
Plain Diff
Fixed run-time conflicts between gyp tests and other tests
parent
fddac963
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/run_tests/run_tests.py
+46
-13
46 additions, 13 deletions
tools/run_tests/run_tests.py
with
46 additions
and
13 deletions
tools/run_tests/run_tests.py
+
46
−
13
View file @
a3e244f2
...
@@ -125,12 +125,11 @@ def get_c_tests(travis, test_lang) :
...
@@ -125,12 +125,11 @@ def get_c_tests(travis, test_lang) :
platforms_str
=
'
ci_platforms
'
if
travis
else
'
platforms
'
platforms_str
=
'
ci_platforms
'
if
travis
else
'
platforms
'
with
open
(
'
tools/run_tests/tests.json
'
)
as
f
:
with
open
(
'
tools/run_tests/tests.json
'
)
as
f
:
js
=
json
.
load
(
f
)
js
=
json
.
load
(
f
)
binaries
=
[
tgt
return
[
tgt
for
tgt
in
js
for
tgt
in
js
if
tgt
[
'
language
'
]
==
test_lang
and
if
tgt
[
'
language
'
]
==
test_lang
and
platform_string
()
in
tgt
[
platforms_str
]
and
platform_string
()
in
tgt
[
platforms_str
]
and
not
(
travis
and
tgt
[
'
flaky
'
])]
not
(
travis
and
tgt
[
'
flaky
'
])]
return
binaries
class
CLanguage
(
object
):
class
CLanguage
(
object
):
...
@@ -144,7 +143,7 @@ class CLanguage(object):
...
@@ -144,7 +143,7 @@ class CLanguage(object):
out
=
[]
out
=
[]
binaries
=
get_c_tests
(
travis
,
self
.
test_lang
)
binaries
=
get_c_tests
(
travis
,
self
.
test_lang
)
for
target
in
binaries
:
for
target
in
binaries
:
if
config
.
build_config
in
t
g
t
[
'
exclude_configs
'
]:
if
config
.
build_config
in
t
arge
t
[
'
exclude_configs
'
]:
continue
continue
if
self
.
platform
==
'
windows
'
:
if
self
.
platform
==
'
windows
'
:
binary
=
'
vsprojects/%s/%s.exe
'
%
(
binary
=
'
vsprojects/%s/%s.exe
'
%
(
...
@@ -169,6 +168,9 @@ class CLanguage(object):
...
@@ -169,6 +168,9 @@ class CLanguage(object):
def
build_steps
(
self
):
def
build_steps
(
self
):
return
[]
return
[]
def
makefile_name
(
self
):
return
'
Makefile
'
def
supports_multi_config
(
self
):
def
supports_multi_config
(
self
):
return
True
return
True
...
@@ -194,7 +196,7 @@ class GYPCLanguage(object):
...
@@ -194,7 +196,7 @@ class GYPCLanguage(object):
for
binary
in
gyp_test_paths
(
travis
,
config
)]
for
binary
in
gyp_test_paths
(
travis
,
config
)]
def
pre_build_steps
(
self
):
def
pre_build_steps
(
self
):
return
[[
'
gyp
'
,
'
--depth=.
'
,
'
grpc.gyp
'
]]
return
[[
'
gyp
'
,
'
--depth=.
'
,
'
--suffix=-gyp
'
,
'
grpc.gyp
'
]]
def
make_targets
(
self
):
def
make_targets
(
self
):
return
gyp_test_paths
(
False
)
return
gyp_test_paths
(
False
)
...
@@ -202,6 +204,9 @@ class GYPCLanguage(object):
...
@@ -202,6 +204,9 @@ class GYPCLanguage(object):
def
build_steps
(
self
):
def
build_steps
(
self
):
return
[]
return
[]
def
makefile_name
(
self
):
return
'
Makefile-gyp
'
def
supports_multi_config
(
self
):
def
supports_multi_config
(
self
):
return
False
return
False
...
@@ -224,6 +229,9 @@ class NodeLanguage(object):
...
@@ -224,6 +229,9 @@ class NodeLanguage(object):
def
build_steps
(
self
):
def
build_steps
(
self
):
return
[[
'
tools/run_tests/build_node.sh
'
]]
return
[[
'
tools/run_tests/build_node.sh
'
]]
def
makefile_name
(
self
):
return
'
Makefile
'
def
supports_multi_config
(
self
):
def
supports_multi_config
(
self
):
return
False
return
False
...
@@ -246,6 +254,9 @@ class PhpLanguage(object):
...
@@ -246,6 +254,9 @@ class PhpLanguage(object):
def
build_steps
(
self
):
def
build_steps
(
self
):
return
[[
'
tools/run_tests/build_php.sh
'
]]
return
[[
'
tools/run_tests/build_php.sh
'
]]
def
makefile_name
(
self
):
return
'
Makefile
'
def
supports_multi_config
(
self
):
def
supports_multi_config
(
self
):
return
False
return
False
...
@@ -289,6 +300,9 @@ class PythonLanguage(object):
...
@@ -289,6 +300,9 @@ class PythonLanguage(object):
do_newline
=
True
)
do_newline
=
True
)
return
commands
return
commands
def
makefile_name
(
self
):
return
'
Makefile
'
def
supports_multi_config
(
self
):
def
supports_multi_config
(
self
):
return
False
return
False
...
@@ -311,6 +325,9 @@ class RubyLanguage(object):
...
@@ -311,6 +325,9 @@ class RubyLanguage(object):
def
build_steps
(
self
):
def
build_steps
(
self
):
return
[[
'
tools/run_tests/build_ruby.sh
'
]]
return
[[
'
tools/run_tests/build_ruby.sh
'
]]
def
makefile_name
(
self
):
return
'
Makefile
'
def
supports_multi_config
(
self
):
def
supports_multi_config
(
self
):
return
False
return
False
...
@@ -353,6 +370,9 @@ class CSharpLanguage(object):
...
@@ -353,6 +370,9 @@ class CSharpLanguage(object):
else
:
else
:
return
[[
'
tools/run_tests/build_csharp.sh
'
]]
return
[[
'
tools/run_tests/build_csharp.sh
'
]]
def
makefile_name
(
self
):
return
'
Makefile
'
def
supports_multi_config
(
self
):
def
supports_multi_config
(
self
):
return
False
return
False
...
@@ -375,6 +395,9 @@ class ObjCLanguage(object):
...
@@ -375,6 +395,9 @@ class ObjCLanguage(object):
def
build_steps
(
self
):
def
build_steps
(
self
):
return
[[
'
src/objective-c/tests/build_tests.sh
'
]]
return
[[
'
src/objective-c/tests/build_tests.sh
'
]]
def
makefile_name
(
self
):
return
'
Makefile
'
def
supports_multi_config
(
self
):
def
supports_multi_config
(
self
):
return
False
return
False
...
@@ -397,6 +420,9 @@ class Sanity(object):
...
@@ -397,6 +420,9 @@ class Sanity(object):
def
build_steps
(
self
):
def
build_steps
(
self
):
return
[]
return
[]
def
makefile_name
(
self
):
return
'
Makefile
'
def
supports_multi_config
(
self
):
def
supports_multi_config
(
self
):
return
False
return
False
...
@@ -418,6 +444,9 @@ class Build(object):
...
@@ -418,6 +444,9 @@ class Build(object):
def
build_steps
(
self
):
def
build_steps
(
self
):
return
[]
return
[]
def
makefile_name
(
self
):
return
'
Makefile
'
def
supports_multi_config
(
self
):
def
supports_multi_config
(
self
):
return
True
return
True
...
@@ -543,7 +572,7 @@ if len(build_configs) > 1:
...
@@ -543,7 +572,7 @@ if len(build_configs) > 1:
sys
.
exit
(
1
)
sys
.
exit
(
1
)
if
platform
.
system
()
==
'
Windows
'
:
if
platform
.
system
()
==
'
Windows
'
:
def
make_jobspec
(
cfg
,
targets
):
def
make_jobspec
(
cfg
,
targets
,
makefile
=
'
Makefile
'
):
extra_args
=
[]
extra_args
=
[]
# better do parallel compilation
# better do parallel compilation
extra_args
.
extend
([
"
/m
"
])
extra_args
.
extend
([
"
/m
"
])
...
@@ -557,23 +586,27 @@ if platform.system() == 'Windows':
...
@@ -557,23 +586,27 @@ if platform.system() == 'Windows':
shell
=
True
,
timeout_seconds
=
90
*
60
)
shell
=
True
,
timeout_seconds
=
90
*
60
)
for
target
in
targets
]
for
target
in
targets
]
else
:
else
:
def
make_jobspec
(
cfg
,
targets
):
def
make_jobspec
(
cfg
,
targets
,
makefile
=
'
Makefile
'
):
return
[
jobset
.
JobSpec
([
os
.
getenv
(
'
MAKE
'
,
'
make
'
),
return
[
jobset
.
JobSpec
([
os
.
getenv
(
'
MAKE
'
,
'
make
'
),
'
-f
'
,
makefile
,
'
-j
'
,
'
%d
'
%
(
multiprocessing
.
cpu_count
()
+
1
),
'
-j
'
,
'
%d
'
%
(
multiprocessing
.
cpu_count
()
+
1
),
'
EXTRA_DEFINES=GRPC_TEST_SLOWDOWN_MACHINE_FACTOR=%f
'
%
'
EXTRA_DEFINES=GRPC_TEST_SLOWDOWN_MACHINE_FACTOR=%f
'
%
args
.
slowdown
,
args
.
slowdown
,
'
CONFIG=%s
'
%
cfg
]
+
targets
,
'
CONFIG=%s
'
%
cfg
]
+
targets
,
timeout_seconds
=
30
*
60
)]
timeout_seconds
=
30
*
60
)]
make_targets
=
{}
for
l
in
languages
:
makefile
=
l
.
makefile_name
()
make_targets
[
makefile
]
=
make_targets
.
get
(
makefile
,
set
()).
union
(
set
(
l
.
make_targets
()))
make_targets
=
list
(
set
(
itertools
.
chain
.
from_iterable
(
l
.
make_targets
()
for
l
in
languages
)))
build_steps
=
list
(
set
(
build_steps
=
list
(
set
(
jobset
.
JobSpec
(
cmdline
,
environ
=
{
'
CONFIG
'
:
cfg
})
jobset
.
JobSpec
(
cmdline
,
environ
=
{
'
CONFIG
'
:
cfg
})
for
cfg
in
build_configs
for
cfg
in
build_configs
for
l
in
languages
for
l
in
languages
for
cmdline
in
l
.
pre_build_steps
()))
for
cmdline
in
l
.
pre_build_steps
()))
if
make_targets
:
if
make_targets
:
make_commands
=
itertools
.
chain
.
from_iterable
(
make_jobspec
(
cfg
,
make_
targets
)
for
cfg
in
build_configs
)
make_commands
=
itertools
.
chain
.
from_iterable
(
make_jobspec
(
cfg
,
list
(
targets
)
,
makefile
)
for
cfg
in
build_configs
for
(
makefile
,
targets
)
in
make_targets
.
iteritems
()
)
build_steps
.
extend
(
set
(
make_commands
))
build_steps
.
extend
(
set
(
make_commands
))
build_steps
.
extend
(
set
(
build_steps
.
extend
(
set
(
jobset
.
JobSpec
(
cmdline
,
environ
=
{
'
CONFIG
'
:
cfg
})
jobset
.
JobSpec
(
cmdline
,
environ
=
{
'
CONFIG
'
:
cfg
})
...
...
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
sign in
to comment