Skip to content

Commit 1b65802

Browse files
Merge branch 'develop' into update-subclass-language-use-override
2 parents a909603 + 9d713ff commit 1b65802

File tree

9 files changed

+39
-18
lines changed

9 files changed

+39
-18
lines changed

.github/workflows/automated-tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
permissions:
1313
contents: read
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
1519
jobs:
1620
code-style-check:
1721
runs-on: ubuntu-latest

.github/workflows/electron-rebuild.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@ jobs:
2121
run: node --run install-mm
2222
- name: Install @electron/rebuild
2323
run: npm install @electron/rebuild
24-
- name: Install node-libgpiod deps
25-
run: |
26-
sudo apt-get update
27-
sudo apt-get install gpiod libgpiod2 libgpiod-dev
28-
- name: Install test library (node-libgpiod) to be rebuilded
29-
run: npm install node-libgpiod
24+
- name: Install test library (serialport) to be rebuilt
25+
run: npm install serialport
3026
- name: Run electron-rebuild
3127
run: npx electron-rebuild
3228
continue-on-error: false

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ planned for 2026-01-01
2222
- [check_config] refactor: improve error handling (#3927)
2323
- [calendar] test: remove "Recurring event per timezone" test (#3929)
2424
- [calendar] chore: remove `requiresVersion: "2.1.0"` (#3932)
25-
- [tests] migrate from `jest` to `vitest` (#3940)
25+
- [tests] migrate from `jest` to `vitest` (#3940, #3941)
26+
- [ci] Add concurrency to automated tests workflow to cancel outdated runs (#3943)
27+
- [tests] replace `node-libgpiod` with `serialport` in electron-rebuild workflow (#3945)
2628
- [weatherprovider] update override warning wording (#3914)
2729

2830
### Fixed

js/server_functions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ async function cors (req, res) {
5858
res.send(data);
5959
}
6060
} catch (error) {
61-
Log.error(error);
61+
// Only log errors in non-test environments to keep test output clean
62+
if (process.env.mmTestMode !== "true") {
63+
Log.error(error);
64+
}
6265
res.send(error);
6366
}
6467
}

modules/default/updatenotification/git_helper.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ class GitHelper {
183183
this.gitResultList.push(gitInfo);
184184
}
185185
} catch (e) {
186-
Log.error(`Failed to retrieve repo info for ${repo.module}: ${e}`);
186+
// Only log errors in non-test environments to keep test output clean
187+
if (process.env.mmTestMode !== "true") {
188+
Log.error(`Failed to retrieve repo info for ${repo.module}: ${e}`);
189+
}
187190
}
188191
}
189192

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"vitest": "^4.0.6"
122122
},
123123
"optionalDependencies": {
124-
"electron": "^38.3.0"
124+
"electron": "^39.0.0"
125125
},
126126
"engines": {
127127
"node": ">=22.20.0 <23 || >=24"

tests/configs/modules/calendar/symboltest.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ let config = {
1212
maximumEntries: 1,
1313
calendars: [
1414
{
15-
fetchInterval: 7 * 24 * 60 * 60 * 1000,
1615
symbol: ["calendar-check", "google"],
17-
url: "https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics"
16+
url: "http://localhost:8080/tests/mocks/12_events.ics"
1817
}
1918
]
2019
}

tests/utils/vitest-setup.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
/**
2-
* Vitest setup file for module aliasing
2+
* Vitest setup file for module aliasing and CI logging
33
* This allows require("logger") to work in unit tests
44
*/
55

66
const Module = require("node:module");
77
const path = require("node:path");
88

9+
// Set test mode flag for application code to detect test environment
10+
process.env.mmTestMode = "true";
11+
912
// Store the original require
1013
const originalRequire = Module.prototype.require;
1114

15+
// Track if we've already applied log level
16+
let logLevelApplied = false;
17+
1218
// Override require to handle our custom aliases
1319
Module.prototype.require = function (id) {
1420
// Handle "logger" alias
1521
if (id === "logger") {
16-
return originalRequire.call(this, path.resolve(__dirname, "../../js/logger.js"));
22+
const logger = originalRequire.call(this, path.resolve(__dirname, "../../js/logger.js"));
23+
24+
// Suppress debug/info logs in CI to keep output clean
25+
if (!logLevelApplied && process.env.CI === "true") {
26+
logger.setLogLevel("ERROR");
27+
logLevelApplied = true;
28+
}
29+
30+
return logger;
1731
}
1832

1933
// Handle all other requires normally

0 commit comments

Comments
 (0)