Skip to content

Commit

Permalink
Update to use parallel testing (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Feb 2, 2024
1 parent 9bf23e4 commit 3b38bcc
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/src/tests/run_trees.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function toArray<T>(iterable: AsyncIterable<T>): Promise<T[]> {
return result;
}

test("Test post and patch run", async () => {
test.concurrent("Test post and patch run", async () => {
const projectName = `__test_run_tree`;
const langchainClient = new Client({});
const projects = await toArray(langchainClient.listProjects());
Expand Down
2 changes: 1 addition & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tests_watch:
poetry run ptw --now . -- -vv -x tests/unit_tests

integration_tests:
poetry run pytest tests/integration_tests
poetry run pytest -n auto tests/integration_tests

lint:
poetry run ruff .
Expand Down
2 changes: 2 additions & 0 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,8 @@ def _run_transform(
run_create["inputs"] = _hide_inputs(run_create["inputs"])
if "outputs" in run_create:
run_create["outputs"] = _hide_outputs(run_create["outputs"])
if not run_create.get("start_time"):
run_create["start_time"] = datetime.datetime.utcnow()
return run_create

@staticmethod
Expand Down
36 changes: 35 additions & 1 deletion python/poetry.lock

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

1 change: 1 addition & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ psutil = "^5.9.5"
freezegun = "^1.2.2"
pytest-subtests = "^0.11.0"
pytest-watcher = "^0.3.4"
pytest-xdist = "^3.5.0"

[tool.poetry.group.lint.dependencies]
openai = "^1.10"
Expand Down
1 change: 0 additions & 1 deletion python/tests/integration_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def test_persist_update_run(
inputs={"text": "hello world"},
project_name=project_name,
api_url=os.getenv("LANGCHAIN_ENDPOINT"),
execution_order=1,
start_time=start_time,
extra={"extra": "extra"},
revision_id=revision_id,
Expand Down
1 change: 0 additions & 1 deletion python/tests/integration_tests/test_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ async def my_chain_run(text: str):
runs_dict = {run.name: run for run in runs}
assert runs_dict["my_chain_run"].parent_run_id is None
assert runs_dict["my_chain_run"].run_type == "chain"
assert runs_dict["my_chain_run"].execution_order == 1
assert runs_dict["my_run"].parent_run_id == runs_dict["my_chain_run"].id
assert runs_dict["my_run"].run_type == "chain"
assert runs_dict["my_llm_run"].parent_run_id == runs_dict["my_run"].id
Expand Down

0 comments on commit 3b38bcc

Please sign in to comment.