Skip to content

test: add comprehensive Data Store V2 acceptance coverage - #211

Open
priya-ni wants to merge 3 commits into
mainfrom
users/pgopal/add-v2-acceptance-tests
Open

priya-ni wants to merge 3 commits into
mainfrom
users/pgopal/add-v2-acceptance-tests

Conversation

@priya-ni

Copy link
Copy Markdown
Contributor

What does this Pull Request accomplish?

Adds acceptance coverage for Data Store V2 resource creation, measurement values and limits, condition lifecycle, metadata expansion, queries, pagination, and resource mutations. Documents how to run the V2 suite separately from V1.

Why should this Pull Request be merged?

Provides broader end-to-end coverage for V2 workflows and helps catch regressions in service interactions. V2 does not currently expose batch condition publishing or standalone condition queries, so those V1 cases have no V2 equivalent.

What testing has been done?

  • pytest -q tests/unit: 485 passed
  • pytest --collect-only -q tests/acceptance_v2: 39 tests collected
  • Black formatting check passed
  • Mypy passed

The service-backed V2 acceptance tests were not run; they require a V2 DataStore service and publish data.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Metadata expansion tests reject correct results because they compare against inputs lacking assigned IDs, while pagination tests can pass even when page-size limits are ignored.

2 open issues
What changed in this PR

Adds a separate Data Store V2 acceptance suite to broaden end-to-end coverage of the Python client without changing production code.

Changes:

  • Covers measurement values, limits, batch creation, condition lifecycle, and metadata expansion.
  • Adds resource filtering, pagination, update, and deletion tests.
  • Documents running V2 acceptance tests separately from V1.

The service-backed V2 tests have not yet been run, as noted in the PR description.

File Description
tests/​acceptance_v2/​test_resource_lifecycle.py Tests batch creation, updates, and deletion.
tests/​acceptance_v2/​test_query_resources.py Tests resource filtering by ID and name.
tests/​acceptance_v2/​test_query_pagination.py Tests step and test-result pagination.
tests/​acceptance_v2/​test_publish_with_metadata.py Tests metadata references, expansion, extensions, and waveform readback.
tests/​acceptance_v2/​test_publish_measurement_batch_and_read_data.py Tests vectors and batch measurement readback.
tests/​acceptance_v2/​test_publish_measurement_and_read_data.py Tests round trips for supported measurement value types.
tests/​acceptance_v2/​test_publish_condition_and_read_data.py Tests condition values, replacement, and removal.
tests/​acceptance_v2/​test_measurement_value_options.py Tests reading measurement values and limits.
tests/​acceptance_v2/​test_data_store.py Tests core V2 fields and measurement pagination.
tests/​acceptance_v2/​conftest.py Provides the shared service-context fixture.
tests/​acceptance_v2/​_utils.py Adds a test-result and step creation helper.
tests/​acceptance_v2/​__init__.py Defines the V2 acceptance-test package.
CONTRIBUTING.md Documents the V2 test command and condition API exclusions.

Review effort: Balanced

priya-ni and others added 2 commits November 24, 2026 13:36
Update assertions to retrieve items from metadata store.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@priya-ni
priya-ni marked this pull request as ready for review November 24, 2026 08:10
@priya-ni
priya-ni requested a review from a team as a code owner November 24, 2026 08:10
@dixonjoel

Copy link
Copy Markdown
Contributor

I don't understand why we can't run these acceptance tests, at least locally on a dev machine. We do have the basic V2 data store service running, right?

@@ -0,0 +1 @@
"""Acceptance tests for a V2 Data Store service."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot analysis of how complete the acceptance tests are. There's room for improvement but this PR is a good start on the coverage. Depending on the resources and time we have consider adding some more coverage for edge cases. I'm sure Copilot could do the bulk of these additions.

Overall

The suite has good breadth on happy paths, especially measurement-value round trips, common resource operations, and cross-resource metadata. It is not comprehensive coverage of the v2 client: important API groups and failure/edge behavior are missing.

There are 24 test functions, expanding to 39 pytest cases: the measurement-value test covers 12 types, and the condition test covers 5 value types. This is a static review; I did not run the suite or measure code coverage.

What’s covered well

  • Measurement values: Round trips for scalars, JSON, XYData, spectra, and analog, digital, and complex waveforms, including some dtype variants (publish/read values). Batch tests cover vectors and analog waveforms (batch measurements).
  • Conditions and limits: Common condition value types, units, replacement/removal, and JSON mappings (conditions); measurement values and lower/upper limits (measurement limits).
  • Core resource workflows: Individual and batch create/update/delete for test results, steps, and measurements (resource lifecycle).
  • Queries: ID and name filters for all three resource types, plus page-token traversal for measurements, steps, and test results (resource queries, pagination).
  • Metadata integration: One end-to-end case exercises many linked metadata resources, extensions, and a waveform measurement (metadata test).

Main gaps

  1. Several client APIs have no acceptance coverage. In particular, I found no tests for get_measurement or the post-creation metadata add/remove methods (client methods, metadata methods).
  2. Updates are narrow. Tests update a test-result link and step/measurement notes; they don’t exercise clearing optional fields, status/outcome/time updates, or other update-field combinations (resource mutations).
  3. Mostly successful, small, valid inputs. There’s little coverage for invalid IDs/values, service errors, empty batches, partial batch failures, or delete edge cases such as the force option (delete API).
  4. Query coverage is basic. Filters focus on ID and name; pagination uses three matching records and page size one. Other query options, empty results across pages, and token/error cases aren’t covered.
  5. Value round trips don’t span all meaningful data variations. The waveform cases are useful type checks, but they don’t establish coverage for broader timing/scaling metadata or more complex signal contents.

Bottom line: solid smoke/integration coverage for common workflows, but not a thorough behavioral safety net for the v2 client. The highest-value additions would be tests for metadata mutation APIs, get_measurement, update/clear semantics, and failure/edge behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As such, I would probably change the title of the PR since it's not really 'comprehensive'. Admittedly, neither was the V1 coverage and we shipped that, so this isn't a criticism of the PR.

@dixonjoel dixonjoel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved with a suggestion to run the tests locally unless there's a good reason we can't yet run them.

This branch has not been deployed

No deployments
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.

3 participants