File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,15 +29,16 @@ jobs:
2929 sh tests/scripts/run_install_deps.sh
3030 - name : Test with pytest
3131 run : |
32+ export ALLOW_OPENAI_API_CALL=0
3233 echo "${{ secrets.METAGPT_KEY_YAML }}" | base64 -d > config/key.yaml
3334 pytest tests/ --doctest-modules --cov=./metagpt/ --cov-report=xml:cov.xml --cov-report=html:htmlcov --durations=20 | tee unittest.txt
3435 - name : Show coverage report
3536 run : |
3637 coverage report -m
3738 - name : Show failed tests and overall summary
3839 run : |
39- grep -E "FAILED tests|[0-9]+ passed," unittest.txt
40- failed_count=$(grep "FAILED" unittest.txt | wc -l)
40+ grep -E "FAILED tests|ERROR tests| [0-9]+ passed," unittest.txt
41+ failed_count=$(grep "FAILED|ERROR " unittest.txt | wc -l)
4142 if [[ "$failed_count" -gt 0 ]]; then
4243 echo "$failed_count failed lines found! Task failed."
4344 exit 1
Original file line number Diff line number Diff line change 2323from tests .mock .mock_llm import MockLLM
2424
2525RSP_CACHE_NEW = {} # used globally for producing new and useful only response cache
26- ALLOW_OPENAI_API_CALL = os . environ . get (
27- "ALLOW_OPENAI_API_CALL" , True
28- ) # NOTE: should change to default False once mock is complete
26+ ALLOW_OPENAI_API_CALL = int (
27+ os . environ . get ( "ALLOW_OPENAI_API_CALL" , 1 )
28+ ) # NOTE: should change to default 0 ( False) once mock is complete
2929
3030
3131@pytest .fixture (scope = "session" )
You can’t perform that action at this time.
0 commit comments