Skip to content

Commit

Permalink
ci(cd): add daemon test in cd to correct codecov (#1773)
Browse files Browse the repository at this point in the history
* ci(cd): add daemon test in cd to correct codecov
  • Loading branch information
hanxiao committed Jan 24, 2021
1 parent af31c32 commit f2c132a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/cd.yml
Expand Up @@ -202,8 +202,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: |
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml -n 1 --timeout=120 -v --ignore-glob='tests/integration/hub_usage/dummyhub*' ${{ matrix.test-path }}
timeout-minutes: 20
if [[ "${{ matrix.test-path }}" == "tests/distributed/test_against_external_daemon/" ]]; then
docker build -f Dockerfiles/debianx.Dockerfile -t jinaai/jina:test-daemon .
docker run --name jinad --network=host -d jinaai/jina:test-daemon
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml -n 1 --timeout=120 -v --ignore-glob='tests/integration/hub_usage/dummyhub*' ${{ matrix.test-path }}
docker rm -f jinad
else
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml -n 1 --timeout=120 -v --ignore-glob='tests/integration/hub_usage/dummyhub*' ${{ matrix.test-path }}
fi
timeout-minutes: 15
env:
JINAHUB_USERNAME: ${{ secrets.JINAHUB_USERNAME }}
JINAHUB_PASSWORD: ${{ secrets.JINAHUB_PASSWORD }}
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/ci.yml
Expand Up @@ -57,8 +57,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
Expand All @@ -72,12 +70,9 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude .git,__pycache__,docs/source/conf.py,old,build,dist,tests/,jina/hub/
prep-testbed:
needs: lint-flake-8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- id: set-matrix
run: |
sudo apt-get install jq
Expand All @@ -90,8 +85,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: |
echo "PIP_TAG='[devel]'" >> $GITHUB_ENV
- run: |
Expand All @@ -101,7 +94,7 @@ jobs:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
core-test:
needs: prep-testbed
needs: [prep-testbed, commit-lint, lint-flake-8]
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
6 changes: 2 additions & 4 deletions tests/unit/test_echostream.py
Expand Up @@ -14,17 +14,15 @@ def test_simple_zmqlet():
args = set_pea_parser().parse_args([
'--host-in', '0.0.0.0',
'--host-out', '0.0.0.0',
'--port-in', '12346',
'--port-out', '12347',
'--socket-in', 'PULL_CONNECT',
'--socket-out', 'PUSH_CONNECT',
'--timeout-ctrl', '-1'])

args2 = set_pea_parser().parse_args([
'--host-in', '0.0.0.0',
'--host-out', '0.0.0.0',
'--port-in', '12347',
'--port-out', '12346',
'--port-in', str(args.port_out),
'--port-out', str(args.port_in),
'--socket-in', 'PULL_BIND',
'--socket-out', 'PUSH_BIND',
'--uses', '_logforward',
Expand Down
10 changes: 4 additions & 6 deletions tests/unit/test_is_read_message.py
Expand Up @@ -22,17 +22,15 @@ def _post_hook(self, msg: 'Message') -> 'BasePea':
args1 = set_pea_parser().parse_args([
'--host-in', '0.0.0.0',
'--host-out', '0.0.0.0',
'--port-in', '12346',
'--port-out', '12347',
'--socket-in', 'PULL_CONNECT',
'--socket-out', 'PUSH_CONNECT',
'--timeout-ctrl', '-1'])

args2 = set_pea_parser().parse_args([
'--host-in', '0.0.0.0',
'--host-out', '0.0.0.0',
'--port-in', '12347',
'--port-out', '12346',
'--port-in', str(args1.port_out),
'--port-out', str(args1.port_in),
'--socket-in', 'PULL_BIND',
'--socket-out', 'PUSH_BIND',
'--uses', '_clear', # will trigger use
Expand All @@ -42,8 +40,8 @@ def _post_hook(self, msg: 'Message') -> 'BasePea':
args3 = set_pea_parser().parse_args([
'--host-in', '0.0.0.0',
'--host-out', '0.0.0.0',
'--port-in', '12347',
'--port-out', '12346',
'--port-in', str(args1.port_out),
'--port-out', str(args1.port_in),
'--socket-in', 'PULL_BIND',
'--socket-out', 'PUSH_BIND',
'--uses', '_pass', # will NOT trigger use
Expand Down

0 comments on commit f2c132a

Please sign in to comment.