Skip to content
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

chore(weave): Split out Trace and Query tests; move trace tests into dedicated tox envs across py39-312 #2403

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

andrewtruong
Copy link
Collaborator

@andrewtruong andrewtruong commented Sep 17, 2024

Description

https://wandb.atlassian.net/browse/WB-20964

This PR splits out tests into dedicated tox envs for {trace, trace_server, and first party integrations} across the python versions we support.

  1. Py312 tests are legitimately failing, but are commented out to be addressed in a follow-up PR because those changes would otherwise be noisy here. The issues seem to stem from a behaviour change in runtime_checkable which breaks isinstance(obj, Op) checks:
    https://docs.python.org/3/library/typing.html#typing.runtime_checkable

  2. This PR requires the companion:
    https://github.com/wandb/core/pull/23983

Testing

this is testing :)

@andrewtruong andrewtruong requested a review from a team as a code owner September 17, 2024 15:07
@andrewtruong andrewtruong marked this pull request as draft September 17, 2024 15:07
@circle-job-mirror
Copy link

circle-job-mirror bot commented Sep 17, 2024

@andrewtruong andrewtruong force-pushed the andrew/tox3 branch 3 times, most recently from ca5902d to 95217aa Compare September 17, 2024 15:32
@andrewtruong andrewtruong changed the title test4 chore(weave): Split out tests into dedicated tox envs across multiple python versions Sep 18, 2024
@andrewtruong andrewtruong changed the title chore(weave): Split out tests into dedicated tox envs across multiple python versions chore(weave): Split out Trace and Query tests into dedicated tox envs across py39-312 Sep 18, 2024
@andrewtruong andrewtruong marked this pull request as ready for review September 18, 2024 15:18
@andrewtruong andrewtruong changed the title chore(weave): Split out Trace and Query tests into dedicated tox envs across py39-312 chore(weave): Split out Trace and Query tests; move trace tests into dedicated tox envs across py39-312 Sep 18, 2024
@@ -133,7 +220,7 @@ jobs:
--timeout=90 \
--ddtrace \
--durations=5 \
./integrations ./legacy ./trace_server ./trace ./tests
./legacy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed. Anything depending on the client fixture in legacy is misplaced. I just verified this by looking at the 3 cases

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I found 4 cases and commented them out for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not bring them over into trace? They were misplaced?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll bring test_weave_finish_unsets_client over.

I don't think the Monitoring tests are valuable anymore. We don't have that path, and the OpenAI and basic logging stuff has its own set of tests already.

@@ -0,0 +1,61 @@
# These are the base Weave requirements, enough for weave tracking and evaluation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be severely trimmed down - much of this is trace specific. fine to be a followup

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the minimal set described here? If yes we can replace:
https://github.com/wandb/core/blob/master/services/weave-python/requirements.txt

@@ -1,5 +1,10 @@
# These are the base Weave requirements, enough for weave tracking and evaluation
# to work.
# -r requirements.legacy.txt
# COPIED FROM LEGACY:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not put this comment next to where you added these reqs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a temporary "inlining" of -r requirements.legacy.txt because the -r ... syntax is not valid for pip installs using pyproject.toml. I think this form is more obvious that it's a copy-paste vs. annotating individual reqs

In future, we'll remove this altogether and just use pyproject.toml

fail-fast: false
services:
wandbservice:
image: us-central1-docker.pkg.dev/wandb-production/images/local-testcontainer:master
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this base?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the container we use to test things that need gorilla.

Do you think there's a better container to use?

@@ -10,6 +10,6 @@ RUN python3 -m venv venv
RUN --mount=type=cache,target=/root/.cache /bin/bash -c \
"source venv/bin/activate && \
pip install --upgrade pip && \
pip install -r requirements.test.txt"
pip install -r requirements.legacy.test.txt"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right - the legacy tests should be using weave/legacy/Dockerfile.test. This Dockerfile would be used for your tox tests (or deleted if we want to use wandbs)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar here, but I'm following this part of the tests:
https://github.com/wandb/weave/blame/andrew/tox3/.github/workflows/test.yaml#L37-L40

Which seems to be:

  1. A unit test image which is used for the legacy tests below
  2. An integration test image which is used for the weave tests in core

@@ -535,7 +535,7 @@ def test_annotated_images_in_tables(fake_wandb):

def test_annotated_legacy_images_in_tables(fake_wandb):
# Mocking this property makes the payload look like the legacy version.
from wandb.data_types import _ImageFileType
from wandb.sdk.data_types.image import _ImageFileType
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants