-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server : replace behave with pytest #10416
Conversation
Copilot
AI
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 20 changed files in this pull request and generated 1 suggestion.
Files not reviewed (15)
- .devops/nix/python-scripts.nix: Language not supported
- examples/server/tests/.gitignore: Language not supported
- examples/server/tests/requirements.txt: Language not supported
- examples/server/tests/tests.sh: Language not supported
- examples/server/tests/unit/test_ctx_shift.py: Evaluated as low risk
- examples/server/tests/unit/test_basic.py: Evaluated as low risk
- examples/server/tests/unit/test_chat_completion.py: Evaluated as low risk
- examples/server/tests/features/steps/steps.py: Evaluated as low risk
- examples/server/tests/README.md: Evaluated as low risk
- .github/workflows/server.yml: Evaluated as low risk
- examples/server/tests/utils.py: Evaluated as low risk
- examples/server/tests/unit/test_completion.py: Evaluated as low risk
- examples/server/tests/unit/test_rerank.py: Evaluated as low risk
- examples/server/tests/unit/test_slot_save.py: Evaluated as low risk
- examples/server/tests/unit/test_infill.py: Evaluated as low risk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 18 out of 34 changed files in this pull request and generated no suggestions.
Files not reviewed (16)
- .devops/nix/python-scripts.nix: Language not supported
- examples/server/tests/.gitignore: Language not supported
- examples/server/tests/features/ctx_shift.feature: Language not supported
- examples/server/tests/features/embeddings.feature: Language not supported
- examples/server/tests/features/infill.feature: Language not supported
- examples/server/tests/features/issues.feature: Language not supported
- examples/server/tests/features/lora.feature: Language not supported
- examples/server/tests/features/parallel.feature: Language not supported
- examples/server/tests/features/passkey.feature: Language not supported
- examples/server/tests/features/rerank.feature: Language not supported
- examples/server/tests/features/results.feature: Language not supported
- examples/server/tests/features/security.feature: Language not supported
- examples/server/tests/features/server.feature: Language not supported
- examples/server/tests/features/slotsave.feature: Language not supported
- examples/server/tests/features/wrong_usages.feature: Language not supported
- examples/server/tests/requirements.txt: Language not supported
Comments skipped due to low confidence (1)
examples/server/tests/conftest.py:12
- The variable 'server_instances' is used but not defined in this snippet. Ensure it is defined elsewhere in the codebase.
server_instances
@ggerganov I'm glad to say that (more than) half of the code in this PR is written by copilot. This will be very useful in the future, where contributors only need to write the docs and the AI will write all test cases. |
@ggerganov Sorry for pinging, but can you review this PR soon? I planned to add more test cases in near future (updated in the description) |
I've missed this PR somehow - sorry for the delay and don't hesitate to ping me. Will take a look now. |
Seems like @ggerganov Do you have any clue why it fails? |
Likely #10501 is the reason. We should add the |
This may be causing intermittent CI failures:
https://github.com/ggerganov/llama.cpp/actions/runs/12069327600/job/33656351121 From what I could gather, this may be caused by the logging threads not being finished before exiting. |
Thanks for reporting. Yeah, indeed the |
* server : replace behave with pytest * fix test on windows * misc * add more tests * more tests * styling * log less, fix embd test * added all sequential tests * fix coding style * fix save slot test * add parallel completion test * fix parallel test * remove feature files * update test docs * no cache_prompt for some tests * add test_cache_vs_nocache_prompt
Motivation
We already have a test script for server using behave framework. While it works well for common use cases, there are some problems:
steps.py
and one in*.feature
fileProposed solution
My proposed solution is to switch to
pytest
, which is a more "mainstream" framework. This helps reduce the complexity for future contributors, sincepytest
is quite straight-forward to use. Indeed, many parts of this PR is written by vscode github copilot.TODO:
*.feature
filesTest cases to be added in the future:
cache_prompt
and different values ofn_cache_reuse