Skip to content

Commit 281c0e4

Browse files
test: respect GitHub ACTIONS_STEP_DEBUG for verbose test logging
When GitHub Actions step debug logging is enabled via ACTIONS_STEP_DEBUG, bypass both general log suppression (setLogLevel) and intentional error suppression (mmTestMode checks) to provide full diagnostic output for debugging test failures. This maintains clean test output in normal CI runs while enabling verbose logging when explicitly requested via GitHub's "Re-run jobs with debug logging" feature.
1 parent d7348ed commit 281c0e4

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ planned for 2026-01-01
2323
- [calendar] test: remove "Recurring event per timezone" test (#3929)
2424
- [calendar] chore: remove `requiresVersion: "2.1.0"` (#3932)
2525
- [tests] migrate from `jest` to `vitest` (#3940, #3941)
26+
- [test] respect GitHub ACTIONS_STEP_DEBUG for verbose test logging (#3942)
2627

2728
### Fixed
2829

js/server_functions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ async function cors (req, res) {
5959
}
6060
} catch (error) {
6161
// Only log errors in non-test environments to keep test output clean
62-
if (process.env.mmTestMode !== "true") {
62+
// Unless GitHub Actions step debug logging is explicitly enabled
63+
if (process.env.mmTestMode !== "true" || process.env.ACTIONS_STEP_DEBUG === "true") {
6364
Log.error(error);
6465
}
6566
res.send(error);

modules/default/updatenotification/git_helper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ class GitHelper {
184184
}
185185
} catch (e) {
186186
// Only log errors in non-test environments to keep test output clean
187-
if (process.env.mmTestMode !== "true") {
187+
// Unless GitHub Actions step debug logging is explicitly enabled
188+
if (process.env.mmTestMode !== "true" || process.env.ACTIONS_STEP_DEBUG === "true") {
188189
Log.error(`Failed to retrieve repo info for ${repo.module}: ${e}`);
189190
}
190191
}

tests/utils/vitest-setup.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Module.prototype.require = function (id) {
2222
const logger = originalRequire.call(this, path.resolve(__dirname, "../../js/logger.js"));
2323

2424
// Suppress debug/info logs in CI to keep output clean
25-
if (!logLevelApplied && process.env.CI === "true") {
25+
// Unless GitHub Actions step debug logging is enabled
26+
if (!logLevelApplied && process.env.CI === "true" && process.env.ACTIONS_STEP_DEBUG !== "true") {
2627
logger.setLogLevel("ERROR");
2728
logLevelApplied = true;
2829
}

0 commit comments

Comments
 (0)