mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-01 16:18:27 +00:00
fix(test): fix make test failed (#2502)
This commit is contained in:
parent
996f41615a
commit
5a35023090
28
Makefile
28
Makefile
@ -19,18 +19,30 @@ $(VENV)/.venv-timestamp: uv.lock
|
||||
uv venv --python 3.11 $(VENV)
|
||||
uv pip install --prefix $(VENV) ruff
|
||||
uv pip install --prefix $(VENV) mypy
|
||||
uv pip install --prefix $(VENV) pytest
|
||||
touch $(VENV)/.venv-timestamp
|
||||
|
||||
testenv: $(VENV)/.testenv
|
||||
|
||||
$(VENV)/.testenv: $(VENV)/bin/activate
|
||||
. $(VENV_BIN)/activate && uv sync --active --all-packages \
|
||||
--extra "base" \
|
||||
--extra "proxy_openai" \
|
||||
--extra "rag" \
|
||||
--extra "storage_chromadb" \
|
||||
--extra "dbgpts" \
|
||||
--link-mode=copy
|
||||
# check uv version and use appropriate parameters
|
||||
if . $(VENV_BIN)/activate && uv sync --help | grep -q -- "--active"; then \
|
||||
. $(VENV_BIN)/activate && uv sync --active --all-packages \
|
||||
--extra "base" \
|
||||
--extra "proxy_openai" \
|
||||
--extra "rag" \
|
||||
--extra "storage_chromadb" \
|
||||
--extra "dbgpts" \
|
||||
--link-mode=copy; \
|
||||
else \
|
||||
. $(VENV_BIN)/activate && uv sync --all-packages \
|
||||
--extra "base" \
|
||||
--extra "proxy_openai" \
|
||||
--extra "rag" \
|
||||
--extra "storage_chromadb" \
|
||||
--extra "dbgpts" \
|
||||
--link-mode=copy; \
|
||||
fi
|
||||
cp .devcontainer/dbgpt.pth $(VENV)/lib/python3.11/site-packages
|
||||
touch $(VENV)/.testenv
|
||||
|
||||
@ -96,7 +108,7 @@ clean: ## Clean up the environment
|
||||
rm -rf $(VENV)
|
||||
find . -type f -name '*.pyc' -delete
|
||||
find . -type d -name '__pycache__' -delete
|
||||
find . -type d -name '.pytest_cache' -delete
|
||||
# find . -type d -name '.pytest_cache' -delete
|
||||
find . -type d -name '.coverage' -delete
|
||||
|
||||
.PHONY: clean-dist
|
||||
|
@ -198,9 +198,8 @@ def test_extract_union_field_type():
|
||||
)
|
||||
|
||||
desc_list = _get_parameter_descriptions(ComplexConfig)
|
||||
|
||||
# Test union type
|
||||
assert desc_list[0].param_name == "str_with_default"
|
||||
assert desc_list[0].param_name == "union_field"
|
||||
assert desc_list[0].param_type == "string"
|
||||
assert desc_list[0].required is False
|
||||
|
||||
@ -269,7 +268,7 @@ def test_python_type_hint_variations():
|
||||
|
||||
# Test nested Optional with Union
|
||||
assert desc_list[4].param_name == "nested_optional"
|
||||
assert desc_list[4].param_type == "integer"
|
||||
assert desc_list[4].param_type == "string"
|
||||
assert desc_list[4].required is False
|
||||
|
||||
# Test nested | syntax
|
||||
|
Loading…
Reference in New Issue
Block a user