Repository navigation
Conversation
There was a problem hiding this comment.
🟡 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
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>
|
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.""" | |||
There was a problem hiding this comment.
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
- Several client APIs have no acceptance coverage. In particular, I found no tests for
get_measurementor the post-creation metadata add/remove methods (client methods,metadata methods). - 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). - 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
forceoption (delete API). - 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.
- 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.
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Approved with a suggestion to run the tests locally unless there's a good reason we can't yet run them.


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 passedpytest --collect-only -q tests/acceptance_v2: 39 tests collectedThe service-backed V2 acceptance tests were not run; they require a V2 DataStore service and publish data.