Skip to content

Commit 11c339a

Browse files
fix button press bug, order in self-test
1 parent 3a8b05a commit 11c339a

File tree

9 files changed

+47
-13
lines changed

9 files changed

+47
-13
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
### Upcoming
2+
3+
#### Bug fixes
4+
5+
- Fixed a UI crash when MQTT `button_down` events triggered tactile-button notifications: custom snackbar content now renders with a ref-able root element so notistack transitions no longer throw `Custom snackbar is not refForwarding`.
6+
- Fix plugins not being loaded correctly in the background task worker. This affected mostly plgin calibrations.
7+
18
### 26.2.26
29

310
#### Bug fixes

core/pioreactor/actions/self_test.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,19 @@
5555

5656

5757
SELF_TEST_TIMEOUT_SECONDS = 180.0
58+
ORDERED_SELF_TEST_NAMES: tuple[str, ...] = (
59+
# order in UI - good for responsiveness.
60+
"test_pioreactor_HAT_present",
61+
"test_all_positive_correlations_between_pds_and_leds",
62+
"test_ambient_light_interference",
63+
"test_REF_is_lower_than_0_dot_256_volts",
64+
"test_REF_is_in_correct_position",
65+
"test_PD_is_near_0_volts_for_blank",
66+
"test_detect_heating_pcb",
67+
"test_positive_correlation_between_temperature_and_heating",
68+
"test_positive_correlation_between_rpm_and_stirring",
69+
"test_aux_power_is_not_too_high",
70+
)
5871

5972

6073
class SelfTestTimedOut(TimeoutError):
@@ -590,7 +603,7 @@ def get_failed_test_names() -> Iterator[str]:
590603

591604

592605
def get_all_test_names() -> Iterator[str]:
593-
return (name for name in vars(sys.modules[__name__]).keys() if name.startswith("test_"))
606+
return iter(ORDERED_SELF_TEST_NAMES)
594607

595608

596609
@click.command(name="self_test")

core/pioreactor/web/static/asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"files": {
33
"main.css": "/static/static/css/main.b7eec0ec.css",
4-
"main.js": "/static/static/js/main.16d9b2e7.js",
4+
"main.js": "/static/static/js/main.fc06481d.js",
55
"static/media/roboto-all-500-normal.woff": "/static/static/media/roboto-all-500-normal.0ab669b7a0d19b178f57.woff",
66
"static/media/roboto-all-700-normal.woff": "/static/static/media/roboto-all-700-normal.a457fde362a540fcadff.woff",
77
"static/media/roboto-all-400-normal.woff": "/static/static/media/roboto-all-400-normal.c5d001fa922fa66a147f.woff",
@@ -28,10 +28,10 @@
2828
"static/media/roboto-greek-ext-700-normal.woff2": "/static/static/media/roboto-greek-ext-700-normal.bd9854c751441ccc1a70.woff2",
2929
"index.html": "/static/index.html",
3030
"main.b7eec0ec.css.map": "/static/static/css/main.b7eec0ec.css.map",
31-
"main.16d9b2e7.js.map": "/static/static/js/main.16d9b2e7.js.map"
31+
"main.fc06481d.js.map": "/static/static/js/main.fc06481d.js.map"
3232
},
3333
"entrypoints": [
3434
"static/css/main.b7eec0ec.css",
35-
"static/js/main.16d9b2e7.js"
35+
"static/js/main.fc06481d.js"
3636
]
3737
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/static/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/static/logo192.png"/><link rel="manifest" href="/static/manifest.json"/><script defer="defer" src="/static/static/js/main.16d9b2e7.js"></script><link href="/static/static/css/main.b7eec0ec.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/static/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/static/logo192.png"/><link rel="manifest" href="/static/manifest.json"/><script defer="defer" src="/static/static/js/main.fc06481d.js"></script><link href="/static/static/css/main.b7eec0ec.css" rel="stylesheet"></head><body><div id="root"></div></body></html>

core/pioreactor/web/static/static/js/main.16d9b2e7.js renamed to core/pioreactor/web/static/static/js/main.fc06481d.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/pioreactor/web/static/static/js/main.16d9b2e7.js.LICENSE.txt renamed to core/pioreactor/web/static/static/js/main.fc06481d.js.LICENSE.txt

File renamed without changes.

core/pioreactor/web/static/static/js/main.16d9b2e7.js.map renamed to core/pioreactor/web/static/static/js/main.fc06481d.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/tests/test_self_test.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
os.environ.setdefault("DOT_PIOREACTOR", ".pioreactor")
1111

1212
from pioreactor.actions.self_test import run_tests
13+
from pioreactor.actions.self_test import get_all_test_names
1314

1415

1516
def test_run_tests_success_and_failure_counts() -> None:
@@ -119,3 +120,18 @@ def interrupted(managed_state, logger, unit: str, experiment: str) -> None:
119120
run_tests([interrupted], managed_state, logger, unit="unit", testing_experiment="experiment")
120121

121122
managed_state.publish_setting.assert_not_called()
123+
124+
125+
def test_get_all_test_names_returns_explicit_order() -> None:
126+
assert list(get_all_test_names()) == [
127+
"test_pioreactor_HAT_present",
128+
"test_REF_is_in_correct_position",
129+
"test_all_positive_correlations_between_pds_and_leds",
130+
"test_ambient_light_interference",
131+
"test_REF_is_lower_than_0_dot_256_volts",
132+
"test_PD_is_near_0_volts_for_blank",
133+
"test_detect_heating_pcb",
134+
"test_positive_correlation_between_temperature_and_heating",
135+
"test_aux_power_is_not_too_high",
136+
"test_positive_correlation_between_rpm_and_stirring",
137+
]

frontend/src/components/Snackbar.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,8 @@ export default function Snackbar({
6767
});
6868
}
6969

70-
if (style) {
71-
return <div style={style}>{renderedChildren}</div>;
72-
}
73-
return <>{renderedChildren}</>;
70+
// notistack transition needs a ref-able root element (fragments can't receive refs)
71+
return <div style={style}>{renderedChildren}</div>;
7472
}
7573

7674
return <SnackbarContent message={snackMessage} style={style} />;

0 commit comments

Comments
 (0)