CI: green again (moon update, wasmer + native deps, stale tests)
CI / test (push) Successful in 1m34s
CI / test (push) Successful in 1m34s
CI has failed on every push since Nov 25. In order:
- `moon check` died resolving jqlssg/moonedn: the workflow never ran
`moon update`, so the registry index was missing.
- The wasm-target `moon test` tried to instantiate compositor/{host,network,
portal}, which import chandra:host/* on wasm and only run under the native
host. scripts/test.sh now runs the wasm tests for everything outside
compositor/, and compositor/network + compositor/portal join the native run.
- The JS (jco) host didn't know the launcher's new `session` and `power`
imports; it now has in-memory versions and the configs grant them. Its tests
expect the Digital Clock's 12-hour default ("2:07 PM").
- The native compositor links -lwasmer and kms needs libseat etc.:
setup-toolchain.sh fetches the wasmer C API (WASMER_VERSION=6.1.0) into
.tools/wasmer, test.sh puts it on the C paths, and the workflow apt-installs
libseat/libdrm/libinput/libudev/libxkbcommon dev packages.
- Stale compositor tests: moon-disc has no source in the tree, so tests use
network / clock-binary instead (the wasm test skips moon-disc with a notice
when it isn't built); the in-tree layout module is a Tile | Float toggle, not
a popup; the clock lists the calendar's two settings; the settings popup is
390 wide, so the Panel-tab buttons moved right.
Locally scripts/test.sh passes end to end: 59 wasm, 15 host, 144 native tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiRjHvKRKCJHaGFekY
This commit is contained in:
10 files changed
+105
-57
No files matched your search
@@ -69,6 +69,22 @@ fn load_module(name : String) -> Plasmoid {
|
||||
}
|
||||
}
|
||||
|
||||
///| Like load_module, for a module that may not be built (e.g. moon-disc, which has no source
|
||||
/// in the tree): None, with a skip notice, when it isn't in build/components.
|
||||
fn load_optional_module(name : String) -> Plasmoid? {
|
||||
match load("build/components/" + name + ".wasm", test_tokens()) {
|
||||
Ok(p) => Some(p)
|
||||
Err(_) =>
|
||||
match load("../../build/components/" + name + ".wasm", test_tokens()) {
|
||||
Ok(p) => Some(p)
|
||||
Err(_) => {
|
||||
println("skip: \{name}.wasm is not in build/components (no source in the tree)")
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///|
|
||||
fn texts_of(ops : Array[@types.DrawOp]) -> Array[String] {
|
||||
let out : Array[String] = []
|
||||
@@ -97,15 +113,15 @@ fn drain() -> Array[HostRequest] {
|
||||
test "a module's own settings (module-config) are listed and set through wasmer" {
|
||||
let p = load_module("clock-digital")
|
||||
let items = p.config_items()
|
||||
// 12-hour by default: Time format, Show AM/PM, Show date.
|
||||
assert_eq(items.length(), 3)
|
||||
// 12-hour by default: Time format, Show AM/PM, Show date, then the calendar's two settings.
|
||||
assert_eq(items.length(), 5)
|
||||
assert_eq(items[0], { key: "format", label: "Time format", choices: ["24-hour", "12-hour"], value: "12-hour" })
|
||||
assert_eq(items[1].choices.length(), 0) // an on/off switch
|
||||
assert_true(p.set_config("format", "24-hour"))
|
||||
assert_false(p.set_config("format", "24-hour")) // unchanged
|
||||
assert_false(p.set_config("bogus", "x"))
|
||||
assert_eq(p.config_items()[0].value, "24-hour")
|
||||
assert_eq(p.config_items().length(), 2) // no AM/PM switch in 24-hour mode
|
||||
assert_eq(p.config_items().length(), 4) // no AM/PM switch in 24-hour mode
|
||||
let mut ampm = false
|
||||
for op in p.render(p.pref_w, p.pref_h, test_tokens()) {
|
||||
match op {
|
||||
@@ -218,12 +234,12 @@ test "the settings module's Panel tab lists host modules and asks to load, move,
|
||||
assert_false(ts.contains("x1"))
|
||||
}
|
||||
}
|
||||
// Below the tab bar (40): heading (28), the two panel rows (30 each, buttons up at x 222-246,
|
||||
// down 248-272, remove 284-308), heading (28), "Clocks" (22), two Add rows (42 each), Browse.
|
||||
// Below the tab bar (40): heading (28), the two panel rows (30 each; in the 390-wide popup the
|
||||
// buttons are up at x 292-316, down 318-342, remove 354-378), heading (28), "Clocks" (22), two Add rows (42 each), Browse.
|
||||
ignore(p.on_event(true, PointerDown(20, 82))) // w1's row itself: nothing
|
||||
ignore(p.on_event(true, PointerDown(234, 82))) // w1 is first: up does nothing
|
||||
ignore(p.on_event(true, PointerDown(260, 82))) // down
|
||||
ignore(p.on_event(true, PointerDown(296, 112))) // w2's remove
|
||||
ignore(p.on_event(true, PointerDown(304, 82))) // w1 is first: up does nothing
|
||||
ignore(p.on_event(true, PointerDown(330, 82))) // down
|
||||
ignore(p.on_event(true, PointerDown(366, 112))) // w2's remove
|
||||
ignore(p.on_event(true, PointerDown(20, 190))) // add the moon
|
||||
ignore(p.on_event(true, PointerDown(160, 285))) // browse
|
||||
assert_eq(drain(), [
|
||||
@@ -252,9 +268,10 @@ test "interface explorer module toggles through the inspector capability" {
|
||||
|
||||
///|
|
||||
test "moon and digital clock modules render from the clock capability" {
|
||||
let m = load_module("moon-disc")
|
||||
assert_true(m.render(36, 36, test_tokens()).length() > 3)
|
||||
m.unload()
|
||||
if load_optional_module("moon-disc") is Some(m) {
|
||||
assert_true(m.render(36, 36, test_tokens()).length() > 3)
|
||||
m.unload()
|
||||
}
|
||||
let c = load_module("clock-digital")
|
||||
let ts = texts_of(c.render(120, 36, test_tokens()))
|
||||
assert_true(ts[0].has_suffix("AM") || ts[0].has_suffix("PM")) // 12-hour by default
|
||||
|
||||
Reference in new issue
Block a user