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

test(robot-server): Add Hypothesis tests for LabwareOffsetStore #17718

Open
wants to merge 5 commits into
base: edge
Choose a base branch
from

Conversation

SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented Mar 11, 2025

Changelog

This adds Hypothesis tests to cover the work in #17704. Goes towards EXEC-1284.

They basically call random sequences of methods on LabwareOffsetStore with random parameters, and compare their results against a known-good reference implementation. The known-good reference implementation is a quick reimplementation of LabwareOffsetStore based on in-memory Python primitives. So, these tests can catch mistakes in LabwareOffsetStore's SQL queries.

Test Plan and Hands on Testing

Review requests

  • Anything unclear? Anything that could be expressed more elegantly in Hypothesis?
  • Please scrutinize the SimulatedStore reference implementation. It should implement what's documented in LabwareStore.
  • It's slow! Something like 10s on my laptop. I'm not sure if this is because I'm sampling inefficiently, or if this is just the nature of the beast with RuleBasedStateMachine. Anyone have perspective on this? If anyone thinks this is a bit much, I'm happy to add something like a make test-fast Makefile target that skips Hypothesis tests and integration tests.

Risk assessment

No risk.

@SyntaxColoring SyntaxColoring requested a review from a team as a code owner March 11, 2025 13:31
@SyntaxColoring SyntaxColoring requested review from mjhuff and removed request for a team March 11, 2025 13:31
@SyntaxColoring SyntaxColoring changed the base branch from lpc_db_updates to edge March 11, 2025 13:32
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 21.84%. Comparing base (57399e2) to head (ec1784d).
Report is 1 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #17718   +/-   ##
=======================================
  Coverage   21.84%   21.84%           
=======================================
  Files        2822     2822           
  Lines      217431   217431           
  Branches     8214     8214           
=======================================
  Hits        47491    47491           
  Misses     169940   169940           
Flag Coverage Δ
protocol-designer 18.91% <ø> (ø)
step-generation 4.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant