Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a test that's failing for grpcio #312

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ cxx_compiler_version:
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
libabseil:
- '20230125'
- '20230802'
libprotobuf:
- 4.23.3
- 4.23.4
openssl:
- '3'
pin_run_as_build:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/linux_aarch64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ cxx_compiler_version:
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
libabseil:
- '20230125'
- '20230802'
libprotobuf:
- 4.23.3
- 4.23.4
openssl:
- '3'
pin_run_as_build:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/linux_ppc64le_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ cxx_compiler_version:
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
libabseil:
- '20230125'
- '20230802'
libprotobuf:
- 4.23.3
- 4.23.4
openssl:
- '3'
pin_run_as_build:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ cxx_compiler:
cxx_compiler_version:
- '15'
libabseil:
- '20230125'
- '20230802'
libprotobuf:
- 4.23.3
- 4.23.4
macos_machine:
- x86_64-apple-darwin13.4.0
openssl:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ cxx_compiler:
cxx_compiler_version:
- '15'
libabseil:
- '20230125'
- '20230802'
libprotobuf:
- 4.23.3
- 4.23.4
macos_machine:
- arm64-apple-darwin20.0.0
openssl:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ channel_targets:
cxx_compiler:
- vs2019
libabseil:
- '20230125'
- '20230802'
libprotobuf:
- 4.23.3
- 4.23.4
openssl:
- '3'
pin_run_as_build:
Expand Down
4 changes: 3 additions & 1 deletion recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ MACOSX_DEPLOYMENT_TARGET: # [osx and x86_64]
MACOSX_SDK_VERSION: # [osx and x86_64]
- "10.13" # [osx and x86_64]

libabseil:
- 20230802
libprotobuf:
- 4.23.3
- 4.23.4
18 changes: 16 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ source:
- patches/0013-don-t-use-find_dependency-for-protobuf.patch

build:
number: 1
number: 2

outputs:
- name: libgrpc
Expand Down Expand Up @@ -87,7 +87,7 @@ outputs:
- ninja
- pkg-config
# only required for pkg-config test (which wants to find zlib.pc)
- zlib # [win]
- zlib
files:
- cmake_test/
- hello.proto
Expand Down Expand Up @@ -155,10 +155,16 @@ outputs:
- {{ pin_subpackage('libgrpc', exact=True) }}
- __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }} # [osx and x86_64]
test:
source_files:
- examples/
files:
- grpcio_distribtest.py
- test_grpcio_helloworld.py
requires:
- pip
# - grpcio-tools
- protobuf 4.23.4
- openssl 3.1.2
imports:
- grpc
- grpc._cython
Expand All @@ -173,6 +179,14 @@ outputs:
commands:
- python -m pip check
- python grpcio_distribtest.py
# test actual RPC pattern (client & server); other tests did not catch
# https://github.com/conda-forge/grpc-cpp-feedstock/issues/281
- cd examples/python/helloworld
# generate helloworld, see https://grpc.io/docs/languages/python/quickstart/#generate-grpc-code
# - python -m grpc_tools.protoc -I../../protos --python_out=. --pyi_out=. --grpc_python_out=. ../../protos/helloworld.proto
# copy test defined in feedstock to where it needs to run
- cp ../../../test_grpcio_helloworld.py .
- python test_grpcio_helloworld.py

about:
home: https://grpc.io/
Expand Down
31 changes: 31 additions & 0 deletions recipe/test_grpcio_helloworld.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os
import signal
import subprocess
import sys
import time

# this test assumes it is being run in examples/python/helloworld,
# after having generated the helloworld_pb2{,_grpc} modules (see meta.yaml)
import grpc
import helloworld_pb2
import helloworld_pb2_grpc


# start server (and wait a little)
print('Starting server...')
pid = subprocess.Popen([sys.executable, "greeter_server.py"]).pid
time.sleep(5)

# run this a couple times because it happens randomly, see
# https://github.com/conda-forge/grpc-cpp-feedstock/issues/281
print('Running client...')
for _ in range(1000):
with grpc.insecure_channel('localhost:50051') as channel:
stub = helloworld_pb2_grpc.GreeterStub(channel)
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))

# tear down server
print('Terminating server...')
os.kill(pid, signal.SIGTERM)

print('Success!')