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
791ceaab
Commit
791ceaab
authored
8 years ago
by
kpayson64
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #9659 from kpayson64/fix_build
Use unique protoc namespaces
parents
98189603
dbf571ea
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/python/grpcio_tests/tests/protoc_plugin/_split_definitions_test.py
+29
-6
29 additions, 6 deletions
...pcio_tests/tests/protoc_plugin/_split_definitions_test.py
with
29 additions
and
6 deletions
src/python/grpcio_tests/tests/protoc_plugin/_split_definitions_test.py
+
29
−
6
View file @
791ceaab
...
...
@@ -48,6 +48,8 @@ from grpc_tools import protoc
from
tests.unit.framework.common
import
test_constants
_MESSAGES_IMPORT
=
b
'
import
"
messages.proto
"
;
'
_SPLIT_NAMESPACE
=
b
'
package grpc_protoc_plugin.invocation_testing.split;
'
_COMMON_NAMESPACE
=
b
'
package grpc_protoc_plugin.invocation_testing;
'
@contextlib.contextmanager
...
...
@@ -163,7 +165,10 @@ class SameSeparateTest(unittest.TestCase, SeparateTestMixin):
os
.
makedirs
(
self
.
grpc_python_out_directory
)
same_proto_file
=
os
.
path
.
join
(
self
.
proto_directory
,
'
same_separate.proto
'
)
open
(
same_proto_file
,
'
wb
'
).
write
(
same_proto_contents
)
open
(
same_proto_file
,
'
wb
'
).
write
(
same_proto_contents
.
replace
(
_COMMON_NAMESPACE
,
b
'
package grpc_protoc_plugin.invocation_testing.same_separate;
'
))
protoc_result
=
protoc
.
main
([
''
,
'
--proto_path={}
'
.
format
(
self
.
proto_directory
),
...
...
@@ -199,7 +204,11 @@ class SameCommonTest(unittest.TestCase, CommonTestMixin):
os
.
makedirs
(
self
.
python_out_directory
)
same_proto_file
=
os
.
path
.
join
(
self
.
proto_directory
,
'
same_common.proto
'
)
open
(
same_proto_file
,
'
wb
'
).
write
(
same_proto_contents
)
open
(
same_proto_file
,
'
wb
'
).
write
(
same_proto_contents
.
replace
(
_COMMON_NAMESPACE
,
b
'
package grpc_protoc_plugin.invocation_testing.same_common;
'
))
protoc_result
=
protoc
.
main
([
''
,
'
--proto_path={}
'
.
format
(
self
.
proto_directory
),
...
...
@@ -240,8 +249,14 @@ class SplitCommonTest(unittest.TestCase, CommonTestMixin):
'
split_common_messages.proto
'
)
open
(
services_proto_file
,
'
wb
'
).
write
(
services_proto_contents
.
replace
(
_MESSAGES_IMPORT
,
b
'
import
"
split_common_messages.proto
"
;
'
))
open
(
messages_proto_file
,
'
wb
'
).
write
(
messages_proto_contents
)
_MESSAGES_IMPORT
,
b
'
import
"
split_common_messages.proto
"
;
'
)
.
replace
(
_SPLIT_NAMESPACE
,
b
'
package grpc_protoc_plugin.invocation_testing.split_common;
'
))
open
(
messages_proto_file
,
'
wb
'
).
write
(
messages_proto_contents
.
replace
(
_SPLIT_NAMESPACE
,
b
'
package grpc_protoc_plugin.invocation_testing.split_common;
'
))
protoc_result
=
protoc
.
main
([
''
,
'
--proto_path={}
'
.
format
(
self
.
proto_directory
),
...
...
@@ -285,8 +300,16 @@ class SplitSeparateTest(unittest.TestCase, SeparateTestMixin):
'
split_separate_messages.proto
'
)
open
(
services_proto_file
,
'
wb
'
).
write
(
services_proto_contents
.
replace
(
_MESSAGES_IMPORT
,
b
'
import
"
split_separate_messages.proto
"
;
'
))
open
(
messages_proto_file
,
'
wb
'
).
write
(
messages_proto_contents
)
_MESSAGES_IMPORT
,
b
'
import
"
split_separate_messages.proto
"
;
'
)
.
replace
(
_SPLIT_NAMESPACE
,
b
'
package grpc_protoc_plugin.invocation_testing.split_separate;
'
))
open
(
messages_proto_file
,
'
wb
'
).
write
(
messages_proto_contents
.
replace
(
_SPLIT_NAMESPACE
,
b
'
package grpc_protoc_plugin.invocation_testing.split_separate;
'
))
protoc_result
=
protoc
.
main
([
''
,
'
--proto_path={}
'
.
format
(
self
.
proto_directory
),
...
...
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