Skip to content

Commit

Permalink
check for Hat in all these tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Sep 7, 2023
1 parent f160bd9 commit d775799
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### Upcoming
- When installing plugins, any leader-only commands would not be run. This is fixed.
- Base automations now subclass from `pioreactor.automations.BaseAutomationJob`. Nothing the user needs to worry about.
- Fixed bug that ignored `.yml` files in the UI.

### 23.8.29
- Pioreactor's IPv4 and hostname is now displayed under System in the UI.
- In configuration, renamed section `dosing_automation` to `dosing_automation.config` (only applies to new installs). It's recommended for existing users to make this change, too.
Expand Down
13 changes: 12 additions & 1 deletion pioreactor/actions/self_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def test_REF_is_in_correct_position(
# The idea is to trigger stirring on and off and the REF should not see a change in signal / variance, but the other PD should.
from statistics import variance

assert is_HAT_present()

reference_channel = cast(PdChannel, config["od_config.photodiode_channel_reverse"][REF_keyword])
signal_channel = "2" if reference_channel == "1" else "1"

Expand Down Expand Up @@ -120,6 +122,8 @@ def test_all_positive_correlations_between_pds_and_leds(
from pprint import pformat
from random import shuffle

assert is_HAT_present()

# better to err on the side of MORE samples than less - it's only a few extra seconds...
# we randomize to reduce effects of temperature
INTENSITIES = list(range(20, 85, 5))
Expand Down Expand Up @@ -220,6 +224,8 @@ def test_ambient_light_interference(
) -> None:
# test ambient light IR interference. With all LEDs off, and the Pioreactor not in a sunny room, we should see near 0 light.

assert is_HAT_present()

adc_reader = ADCReader(
channels=ALL_PD_CHANNELS,
dynamic_gain=False,
Expand Down Expand Up @@ -275,6 +281,8 @@ def test_REF_is_lower_than_0_dot_256_volts(


def test_PD_is_near_0_volts_for_blank(client, logger: Logger, unit: str, experiment: str) -> None:
assert is_HAT_present()

reference_channel = cast(PdChannel, config["od_config.photodiode_channel_reverse"][REF_keyword])
signal_channel = "2" if reference_channel == "1" else "1"
assert config.get("od_config.photodiode_channel", signal_channel, fallback=None) in [
Expand Down Expand Up @@ -330,7 +338,10 @@ def test_positive_correlation_between_temperature_and_heating(
assert measured_correlation > 0.9, (dcs, measured_pcb_temps)


def test_aux_power_is_not_too_high(client: Client, logger: Logger, unit: str, experiment: str):
def test_aux_power_is_not_too_high(
client: Client, logger: Logger, unit: str, experiment: str
) -> None:
assert is_HAT_present()
assert voltage_in_aux() <= 18.0


Expand Down

0 comments on commit d775799

Please sign in to comment.