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(api): liquid class delay properties enable strict bool and tests #17722

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

Conversation

y3rsh
Copy link
Member

@y3rsh y3rsh commented Mar 11, 2025

Overview

Add unit tests for the builder and setters on DelayProperties

Review Requests

Does the change to StrictBool make sense?
Does this raise code coverage at all?

Risk assessment

Low, mostly tests but a small change to the Model for Delay Properties to be StrictBool

y3rsh and others added 10 commits March 7, 2025 19:42
* edge:
  feat(robot-server): Allow storing and retrieving location-nonspecific ("default") offsets (#17704)
  refactor(step-generation): split up movableTrashCommandsUtil() into separate functions (#17694)
  refactor(api): opentrons driver error handling (#17689)
  fix(api, shared-data): Pick up tc lid directly off deck slot fix (#17683)
  fix(step-generation): make prevRobotState required in movableTrashCommandsUtil (#17705)
  refactor(protocol-designer): account for 96-channel load_instrument syntax & pythonName (#17691)
  chore(components): add a new foldere Helix to Storybook (#17699)
  fix(protocol-designer, shared-data): update command schema to v10 (#17550)
  Revert "feat(step-generation): introduce airGapInPlace command (#17357)"
  Revert "fix(step-generation): properly update robotState when dispense is after airGap (#17392)"
@y3rsh y3rsh self-assigned this Mar 11, 2025
@y3rsh y3rsh requested a review from a team as a code owner March 11, 2025 17:14
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 23.72%. Comparing base (57399e2) to head (79bd36e).
Report is 44 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #17722      +/-   ##
==========================================
+ Coverage   21.84%   23.72%   +1.88%     
==========================================
  Files        2822     2835      +13     
  Lines      217431   218395     +964     
  Branches     8214     9191     +977     
==========================================
+ Hits        47491    51815    +4324     
+ Misses     169940   166574    -3366     
- Partials        0        6       +6     
Flag Coverage Δ
app 2.37% <ø> (?)
protocol-designer 18.94% <ø> (+0.02%) ⬆️
step-generation 4.38% <ø> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
...red_data/liquid_classes/liquid_class_definition.py 95.03% <ø> (-0.04%) ⬇️

... and 162 files with indirect coverage changes

🚀 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.

Comment on lines +14 to +69
# --------------------------------------------------------------------------------------
# Strategies
# --------------------------------------------------------------------------------------

invalid_values = st.one_of(
st.text(min_size=0, max_size=5),
st.dictionaries(keys=st.text(), values=st.integers()),
st.lists(st.integers(min_value=-100, max_value=100), min_size=1, max_size=5),
st.tuples(st.booleans()),
st.binary(min_size=1, max_size=5),
)

boolean_looking_values = st.one_of(
st.just("True"),
st.just("1"),
st.just(1),
st.just("False"),
st.just("0"),
st.just(0),
)

reasonable_floats = st.floats(
min_value=-1000, max_value=1000, allow_infinity=False, allow_nan=False
)
reasonable_ints = st.integers(min_value=-1000, max_value=1000)

negative_or_zero_floats = st.floats(
min_value=-1000, max_value=0, allow_infinity=False, allow_nan=False
)
negative_or_zero_ints = st.integers(min_value=-1000, max_value=0)
negative_or_zero_floats_and_ints = st.one_of(
negative_or_zero_floats, negative_or_zero_ints
)
positive_or_zero_ints = st.integers(min_value=0, max_value=1000)
positive_or_zero_floats = st.floats(
min_value=0, max_value=1000, allow_infinity=False, allow_nan=False
)
positive_or_zero_floats_or_ints = st.one_of(
positive_or_zero_floats, positive_or_zero_ints
)

negative_non_zero_floats = st.floats(
min_value=-1000, max_value=-0.0001, allow_infinity=False, allow_nan=False
)
negative_non_zero_ints = st.integers(min_value=-1000, max_value=-1)
negative_non_zero_floats_and_ints = st.one_of(
negative_non_zero_floats, negative_non_zero_ints
)

positive_non_zero_floats = st.floats(
min_value=0.0001, max_value=1000, allow_infinity=False, allow_nan=False
)
positive_non_zero_ints = st.integers(min_value=1, max_value=1000)
positive_non_zero_floats_and_ints = st.one_of(
positive_non_zero_floats, positive_non_zero_ints
)
Copy link
Member Author

Choose a reason for hiding this comment

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

I will move these into a fixture in the next pull request.

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