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