Skip to content

Commit

Permalink
[CI] Configure tests github actions and add coverage comments (Paddle…
Browse files Browse the repository at this point in the history
…Paddle#4131)

* tests

* remove redundant space

* add regex

* pytest xdist

* pytest command

* fix t5

* report-only-changed-files

* give permission

* github token

* github tokens

* try permissions

* pull request target

* permissions

* test codecov
  • Loading branch information
sijunhe authored Dec 16, 2022
1 parent aa34d0c commit cc085b5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ jobs:
Test:
name: Test
runs-on: ubuntu-20.04
permissions:
pull-requests: write
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v1
Expand All @@ -16,4 +20,6 @@ jobs:
python -m pip install --upgrade pip
make install
- name: run the command
run: make test
run: make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ lint:
test: unit-test

unit-test:
# only enable bert-test: there are many failed tests
PYTHONPATH=$(shell pwd) pytest tests/transformers/bert \
tests/prompt \
tests/transformers/test_configuration_utils.py
PYTHONPATH=$(shell pwd) pytest \
-n auto --cov paddlenlp \
--cov-report xml:coverage.xml

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ exclude = ['.flake8']

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--ignore-glob=tests/data/ --ignore tests/dataset/test_imdb.py --ignore tests/embeddings/test_token_embedding.py --ignore tests/metrics/test_perplexity.py"
addopts = "-ra -q --ignore tests/transformers/t5/test_modeling.py"
testpaths = [
"tests",
"tests/transformers",
"tests/prompt",
"tests/taskflow",
]
4 changes: 3 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ flake8
black
yapf
parameterized
pytest-cov
pytest-cov
regex
pytest-xdist

0 comments on commit cc085b5

Please sign in to comment.