Skip to content

Commit

Permalink
Add more langgraph tests.
Browse files Browse the repository at this point in the history
These exercise the various checkpointers and stores, so we adapt them to
run for the MySQL versions as well.
  • Loading branch information
tjni committed Dec 8, 2024
1 parent 2792a53 commit cd54b9c
Show file tree
Hide file tree
Showing 15 changed files with 22,931 additions and 11 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
######################

start-mysql:
MYSQL_VERSION=${MYSQL_VERSION:-16} docker compose -f tests/compose-mysql.yml up -V --force-recreate --wait
MYSQL_VERSION=${MYSQL_VERSION:-8} docker compose -f tests/compose-mysql.yml up -V --force-recreate --wait

stop-mysql:
docker compose -f tests/compose-mysql.yml down
Expand All @@ -14,7 +14,9 @@ MYSQL_VERSIONS ?= 8
test_mysql_version:
@echo "Testing MySQL $(MYSQL_VERSION)"
@MYSQL_VERSION=$(MYSQL_VERSION) make start-mysql
@poetry run pytest $(TEST)
@poetry run pytest --ignore=tests/langgraph $(TEST)
@poetry run pytest -n auto --dist worksteal tests/langgraph
@LANGGRAPH_FF_SEND_V2=true poetry run pytest -n auto --dist worksteal tests/langgraph
@EXIT_CODE=$$?; \
make stop-mysql; \
echo "Finished testing MySQL $(MYSQL_VERSION); Exit code: $$EXIT_CODE"; \
Expand All @@ -31,7 +33,7 @@ test:

TEST ?= .
test_watch:
POSTGRES_VERSION=${MYSQL_VERSION:-8} make start-mysql; \
MYSQL_VERSION=${MYSQL_VERSION:-8} make start-mysql; \
poetry run ptw $(TEST); \
EXIT_CODE=$$?; \
make stop-mysql; \
Expand Down
140 changes: 132 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ mypy = "^1.10.0"
pymysql = "^1.1.1"
aiomysql = "^0.2.0"
types-PyMySQL = "^1.1.0"
langgraph = "0.2.49"
syrupy = "^4.0.2"
pytest-repeat = "^0.9.3"
pytest-xdist = {extras = ["psutil"], version = "^3.6.1"}

[tool.pytest.ini_options]
# --strict-markers will raise errors on unknown marks.
Expand All @@ -57,6 +61,9 @@ lint.select = [
"I", # isort
]
lint.ignore = ["E501", "B008", "UP007", "UP006"]
exclude = [
"tests/langgraph"
]

[tool.mypy]
# https://mypy.readthedocs.io/en/stable/config_file.html
Expand All @@ -67,3 +74,6 @@ warn_unused_ignores = "True"
warn_redundant_casts = "True"
allow_redefinition = "True"
disable_error_code = "typeddict-item, return-value"
exclude = [
"tests/langgraph"
]
7 changes: 7 additions & 0 deletions tests/compose-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ services:
retries: 5
interval: 60s
start_interval: 1s
configs:
- source: init.sql
target: /docker-entrypoint-initdb.d/init.sql
configs:
init.sql:
content: |
GRANT ALL PRIVILEGES ON *.* TO 'mysql'@'%';
Empty file.
Loading

0 comments on commit cd54b9c

Please sign in to comment.