Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Sep 17, 2024
1 parent 88c46f7 commit 2a7ca61
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#### Bug fixes
- fixed an issue where a calibrated OD reading would be mapped to max OD signal if it was too low.
- fixed an issue where the Pioreactor UI would lock up if trying to create a new experiment with an existing name.
- fixed Hours Elapsed not updating in Overview

#### Breaking changes
- **Lots and lots of API changes**. You'll want to review them on our docs: https://docs.pioreactor.com/developer-guide/web-ui-api
Expand Down
10 changes: 6 additions & 4 deletions pioreactor/tests/test_execute_experiment_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,9 @@ def collect_actions(msg):
allow_retained=False,
)

with start_stirring(target_rpm=500, unit="unit1", experiment=experiment, use_rpm=True):
execute_experiment_profile("profile.yaml", experiment)
with capture_requests():
with start_stirring(target_rpm=500, unit="unit1", experiment=experiment, use_rpm=True):
execute_experiment_profile("profile.yaml", experiment)

assert actions == [500, 1000, 200]

Expand Down Expand Up @@ -730,8 +731,9 @@ def collect_actions(msg):
allow_retained=False,
)

with start_stirring(target_rpm=500, unit="unit1", experiment=experiment, use_rpm=True):
execute_experiment_profile("profile.yaml", experiment)
with capture_requests():
with start_stirring(target_rpm=500, unit="unit1", experiment=experiment, use_rpm=True):
execute_experiment_profile("profile.yaml", experiment)

assert actions == [500, 1000, 200, 400]

Expand Down
11 changes: 6 additions & 5 deletions pioreactor/tests/test_od_reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ def test_calibration_errors_when_pd_channel_differs() -> None:


def test_calibration_with_irl_data1() -> None:
MAX_OD = 1.131
with local_persistant_storage("current_od_calibration") as c:
c["90"] = encode(
structs.OD90Calibration(
Expand All @@ -876,7 +877,7 @@ def test_calibration_with_irl_data1() -> None:
0.0024870149666305712,
],
name="quad_test",
maximum_od600=1.131,
maximum_od600=MAX_OD,
minimum_od600=0.0,
ir_led_intensity=70.0,
angle="90",
Expand All @@ -902,9 +903,9 @@ def test_calibration_with_irl_data1() -> None:
cc.hydate_models_from_disk({"2": "90"})
assert cc({"2": 0.001})["2"] == 0
assert cc({"2": 0.002})["2"] == 0
assert cc({"2": 0.004})["2"] == 0.0032975807375385234
assert cc({"2": 0.020})["2"] == 0.03639585015289039
assert cc({"2": 1.0})["2"] == 1.131
assert abs(cc({"2": 0.004})["2"] - 0.0032975807375385234) < 1e-5
assert abs(cc({"2": 0.020})["2"] - 0.03639585015289039) < 1e-5
assert cc({"2": 1.0})["2"] == MAX_OD

with local_persistant_storage("current_od_calibration") as c:
del c["90"]
Expand Down Expand Up @@ -1054,7 +1055,7 @@ def test_auto_ir_led_intensit_REF_and_90() -> None:
experiment = "test_auto_ir_led_intensity"

with start_od_reading("REF", "90", interval=None, fake_data=True, experiment=experiment) as od:
assert abs(od.ir_led_intensity - 67.19794921875) < 0.001
assert abs(od.ir_led_intensity - 67.19794921875) < 0.01

config["od_reading.config"]["ir_led_intensity"] = existing_intensity

Expand Down
11 changes: 6 additions & 5 deletions update_scripts/upcoming/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

UI_FOLDER=/var/www/pioreactorui
SYSTEMD_DIR=/lib/systemd/system/
UI_TAG="TODO" # TODO
UI_TAG="24.9.16" # TODO
PIO_DIR="/home/pioreactor/.pioreactor"

HOSTNAME=$(hostname)
Expand Down Expand Up @@ -58,11 +58,12 @@ if [ "$HOSTNAME" != "$LEADER_HOSTNAME" ]; then
cp -u "$SCRIPT_DIR"/50-pioreactorui.conf /etc/lighttpd/conf-available/
cp -u "$SCRIPT_DIR"/52-api-only.conf /etc/lighttpd/conf-available/

/usr/sbin/lighttpd-enable-mod fastcgi
/usr/sbin/lighttpd-enable-mod rewrite
/usr/sbin/lighttpd-enable-mod pioreactorui
# lighttpd-enable-mod returns !0 if already enabled, breaking a potential reinstall.
/usr/sbin/lighttpd-enable-mod fastcgi || true
/usr/sbin/lighttpd-enable-mod rewrite || true
/usr/sbin/lighttpd-enable-mod pioreactorui || true
# workers only have an api, not served static files.
/usr/sbin/lighttpd-enable-mod api-only
/usr/sbin/lighttpd-enable-mod api-only || true


cp -u "$SCRIPT_DIR"/create_diskcache.sh /usr/local/bin/
Expand Down

0 comments on commit 2a7ca61

Please sign in to comment.