mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-30 03:16:23 +02:00
enforce mock on online test
This commit is contained in:
parent
afa2411909
commit
8fb5919181
3 changed files with 7 additions and 5 deletions
5
.github/workflows/unittest.yaml
vendored
5
.github/workflows/unittest.yaml
vendored
|
|
@ -33,6 +33,7 @@ jobs:
|
|||
sh tests/scripts/run_install_deps.sh
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
export ALLOW_OPENAI_API_CALL=0
|
||||
echo "${{ secrets.METAGPT_KEY_YAML }}" | base64 -d > config/key.yaml
|
||||
pytest tests/ --doctest-modules --cov=./metagpt/ --cov-report=xml:cov.xml --cov-report=html:htmlcov --durations=20 | tee unittest.txt
|
||||
- name: Show coverage report
|
||||
|
|
@ -40,8 +41,8 @@ jobs:
|
|||
coverage report -m
|
||||
- name: Show failed tests and overall summary
|
||||
run: |
|
||||
grep -E "FAILED tests|[0-9]+ passed," unittest.txt
|
||||
failed_count=$(grep "FAILED" unittest.txt | wc -l)
|
||||
grep -E "FAILED tests|ERROR tests|[0-9]+ passed," unittest.txt
|
||||
failed_count=$(grep "FAILED|ERROR" unittest.txt | wc -l)
|
||||
if [[ "$failed_count" -gt 0 ]]; then
|
||||
echo "$failed_count failed lines found! Task failed."
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue