8000 docs: use port replace port expose in client by bwanglzu · Pull Request #3340 · jina-ai/serve · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

docs: use port replace port expose in client #3340

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

Merged
merged 4 commits into from
Sep 3, 2021
Merged
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
7 changes: 0 additions & 7 deletions .coveragerc

This file was deleted.

1 change: 0 additions & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ codecov:
# https://docs.codecov.io/docs/comparing-commits
allow_coverage_offsets: true
ignore:
- "jina/hub"
- "jina/resources"
coverage:
status:
Expand Down
8 changes: 4 additions & 4 deletions docs/fundamentals/flow/flow-as-a-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ with f:
```python
from jina import Client, Document

c = Client(protocol='grpc', port_expose=12345)
c = Client(protocol='grpc', port=12345)
c.post('/', Document())
```

Expand Down Expand Up @@ -97,7 +97,7 @@ While keep this server open, let's create a client on a different machine:
```python
from jina import Client

c = Client(host='192.168.1.15', port_expose=12345)
c = Client(host='192.168.1.15', port=12345)

c.post('/')
```
Expand Down Expand Up @@ -132,7 +132,7 @@ This will serve the Flow with WebSocket, so any Client connects to it should fol
```python
from jina import Client

c = Client(protocol='websocket', host='192.168.1.15', port_expose=12345)
c = Client(protocol='websocket', host='192.168.1.15', port=12345)
c.post('/')
```

Expand Down Expand Up @@ -265,7 +265,7 @@ One can also use Python Client to send HTTP request, simply:
```python
from jina import Client

c = Client(protocol='http', port_expose=12345)
c = Client(protocol='http', port=12345)
c.post('/', ...)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/fundamentals/flow/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Client:
```python
from jina import Client, Document

c = Client(port_expose=12345)
c = Client(port=12345)
c.post(on='/bar', inputs=Document(), on_done=print)
```

Expand Down
6 changes: 6 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pytest]
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
timeout: marks test timeout duration
asyncio: marks that run async tests
repeat: marks that test run n times
2 changes: 1 addition & 1 deletion tests/integration/crud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class CrudIndexer(Executor):
"""Simple indexer class """
"""Simple indexer class"""

def __init__(self, **kwargs):
super().__init__(**kwargs)
Expand Down
1 change: 0 additions & 1 deletion tests/integration/v2_api/test_returns.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def assert_response(response):
assert response.data.docs[0].id == '1'

class MyExecutor(Executor):

@requests(on='/return_docs')
def return_docs(self, docs, *args, **kwargs):
return docs
Expand Down
9 changes: 5 additions & 4 deletions 6D47 tests/unit/clients/python/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,11 @@ def foo(self, docs, **kwargs):
m3 = mocker.Mock()
m4 = mocker.Mock()
with f:
f.post('/', on_done=m1)
f.post('/foo', docs, on_done=m2)
f.post('/foo', on_done=m3)
f.post('/foo', docs, parameters={'hello': 'world'}, on_done=m4)
c = Client(host='localhost', port=f.port_expose, protocol=protocol)
c.post('/', on_done=m1)
c.post('/foo', docs, on_done=m2)
c.post('/foo', on_done=m3)
c.post('/foo', docs, parameters={'hello': 'world'}, on_done=m4)

m1.assert_called_once()
m2.assert_called()
Expand Down
0