Skip to content

Commit 1537ba3

Browse files
authored
tests: rename tests and fix mlflow integration (#3108)
1 parent 5fd23d2 commit 1537ba3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+698
-3090
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main]
76
pull_request:
87
schedule:
98
- cron: "0 0 * * 1/2"
109

1110
env:
12-
BENTOML_DO_NOT_TRACK: True
1311
LINES: 120
1412
COLUMNS: 120
15-
PYTEST_PLUGINS: bentoml.testing.pytest.plugin
13+
BENTOML_DO_NOT_TRACK: True
1614

1715
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
1816
defaults:
@@ -26,6 +24,7 @@ jobs:
2624
related: ${{ steps.filter.outputs.related }}
2725
bentoml: ${{ steps.filter.outputs.bentoml }}
2826
docs: ${{ steps.filter.outputs.docs }}
27+
protos: ${{ steps.filter.outputs.protos }}
2928
steps:
3029
- uses: actions/checkout@v3
3130
- uses: dorny/paths-filter@v2
@@ -37,8 +36,6 @@ jobs:
3736
- .github/workflows/ci.yml
3837
- codecov.yml
3938
- pyproject.toml
40-
- scripts/ci/config.yml
41-
- scripts/ci/run_tests.sh
4239
- requirements/tests-requirements.txt
4340
protos: &protos
4441
- "src/bentoml/grpc/**/*.proto"
@@ -100,14 +97,22 @@ jobs:
10097
pip install -r requirements/dev-requirements.txt
10198
10299
- name: Format check
103-
run: make ci-format
100+
run: |
101+
black --check src examples tests
102+
black --check --pyi typings
103+
isort --check .
104104
- name: Lint check
105-
run: make ci-lint
105+
run: |
106+
git fetch origin "$GITHUB_BASE_REF"
107+
git diff --name-only --diff-filter=d "origin/$GITHUB_BASE_REF" -z -- '*.py' | xargs -0 --no-run-if-empty pylint --rcfile pyproject.toml --fail-under 9.0 --exit-zero
106108
- name: Type check
107-
run: make ci-pyright
109+
run: |
110+
git fetch origin "$GITHUB_BASE_REF"
111+
git diff --name-only --diff-filter=d "origin/$GITHUB_BASE_REF" -z -- '*.py[i]' | xargs -0 --no-run-if-empty pyright
108112
- name: Proto check
109113
if: ${{ (github.event_name == 'pull_request' && needs.diff.outputs.protos == 'true') || github.event_name == 'push' }}
110-
run: buf lint --config "src/bentoml/grpc/buf.yaml" --error-format msvs src
114+
run: |
115+
buf lint --config "src/bentoml/grpc/buf.yaml" --error-format msvs src
111116
112117
documentation_spelling_check:
113118
runs-on: ubuntu-latest
@@ -193,23 +198,21 @@ jobs:
193198
194199
- name: Run unit tests
195200
run: |
196-
OPTS=(--cov-config pyproject.toml --cov-report=xml:unit.xml -vvv)
201+
OPTS=(--cov-config pyproject.toml --cov=src/bentoml --cov-append)
197202
if [ "${{ matrix.os }}" != 'windows-latest' ]; then
198203
# we will use pytest-xdist to improve tests run-time.
199204
OPTS=(${OPTS[@]} --dist loadfile -n auto --run-grpc-tests)
200205
fi
201206
# Now run the unit tests
202-
python -m pytest tests/unit "${OPTS[@]}"
207+
coverage run -m pytest tests/unit "${OPTS[@]}"
208+
209+
- name: Generage coverage
210+
run: coverage xml
203211

204212
- name: Upload test coverage to Codecov
205213
uses: codecov/codecov-action@v3
206214
with:
207-
name: codecov-${{ matrix.os }}-python${{ matrix.python-version }}
208-
fail_ci_if_error: true
209-
flags: unit-tests
210-
directory: ./
211-
files: ./unit.xml
212-
verbose: true
215+
files: coverage.xml
213216
token: ${{ secrets.CODECOV_TOKEN }}
214217

215218
bento_server_e2e_tests:
@@ -278,17 +281,17 @@ jobs:
278281
fi
279282
280283
- name: Run ${{ matrix.server_type }} tests and generate coverage report
281-
run: ./scripts/ci/run_tests.sh ${{ matrix.server_type }}_server --verbose
284+
run: |
285+
OPTS=(--cov-config pyproject.toml --cov=src/bentoml --cov-append)
286+
coverage run -m pytest tests/e2e/bento_server_${{ matrix.server_type }} "${OPTS[@]}"
287+
288+
- name: Generage coverage
289+
run: coverage xml
282290

283291
- name: Upload test coverage to Codecov
284292
uses: codecov/codecov-action@v3
285293
with:
286-
flags: e2e-tests-${{ matrix.server_type }}
287-
name: codecov-${{ matrix.os }}-python${{ matrix.python-version }}-e2e
288-
fail_ci_if_error: true
289-
directory: ./
290-
files: ./tests/e2e/bento_server_${{ matrix.server_type }}/${{ matrix.server_type }}_server.xml
291-
verbose: true
294+
files: coverage.xml
292295
token: ${{ secrets.CODECOV_TOKEN }}
293296

294297
concurrency:

0 commit comments

Comments
 (0)