Skip to content

Commit

Permalink
Add Codecov test coverage (#1397)
Browse files Browse the repository at this point in the history
* Add pytest-cov dependency

* Add codecov to unit test CI

* Codecov: Use secrets

* Add codecov for integration tests
  • Loading branch information
li-boxuan committed Apr 29, 2024
1 parent 03ecec1 commit a5a1545
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 121 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/run-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@ jobs:
run: |
rm -rf workspace
mkdir workspace
WORKSPACE_BASE="$GITHUB_WORKSPACE/workspace" WORKSPACE_MOUNT_PATH="$GITHUB_WORKSPACE/workspace" poetry run pytest -s ./tests/integration
WORKSPACE_BASE="$GITHUB_WORKSPACE/workspace" \
WORKSPACE_MOUNT_PATH="$GITHUB_WORKSPACE/workspace" \
poetry run pytest --cov=agenthub --cov=opendevin --cov-report=xml \
-s ./tests/integration
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test_matrix_success:
name: All Integration Tests Passed
runs-on: ubuntu-latest
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ jobs:
run: make build

- name: Run Tests
run: poetry run pytest ./tests/unit
run: poetry run pytest --cov=agenthub --cov=opendevin --cov-report=xml ./tests/unit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test-on-linux:
name: Test on Linux
runs-on: ubuntu-latest
Expand All @@ -65,8 +69,11 @@ jobs:
run: make build

- name: Run Tests
run: poetry run pytest ./tests/unit

run: poetry run pytest --cov=agenthub --cov=opendevin --cov-report=xml ./tests/unit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test_matrix_success:
name: All Mac/Linux Tests Passed
runs-on: ubuntu-latest
Expand Down

0 comments on commit a5a1545

Please sign in to comment.