Skip to content

Disable diagnostic data reporting in the test installation - #738

Merged
GermanBluefox merged 1 commit into
ioBroker:masterfrom
krobipd:fix/disable-diag-in-test-controller
Sep 29, 2026
Merged

GermanBluefox merged 1 commit into
ioBroker:masterfrom
krobipd:fix/disable-diag-in-test-controller

Conversation

@krobipd

@krobipd krobipd commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Why

@iobroker/plugin-sentry switches itself off only when CI/TRAVIS/APPVEYOR is set, when the instance or host has disableDataReporting, or when system.config.common.diag is 'none'. The integration test controller keeps diag: 'extended' from setup first, and @iobroker/testing changes nothing about it. On a developer machine (no CI), whether the plugin of the adapter under test is active therefore depends on the plugins.sentry.enabled state the controller setup happens to leave behind — and when it is active, errors of the test run (for example DB closed while the harness shuts the databases down) end up in the adapter's Sentry project.

Measured on one machine across twelve local test installations: the adapter's plugins.sentry.enabled was true in 9 of the 11 that had the state (js-controller 8.0.0-alpha and one 7.2.2 install) and false in two (7.2.2) — it varies with the setup, not with the adapter.

The rest of the ecosystem already turns diagnostics off for its throwaway installations: @iobroker/dev-server (src/commands/Setup.ts, diag = 'none'), @iobroker/legacy-testing (engineHelper.ts), and the create-adapter dev container (iob plugin disable sentry + diagnostics off). The diag === 'none' rule in the plugin exists at least since 1.2.1 (checked 1.2.1, 2.0.4, 3.1.4, 3.2.1).

What

  • New ControllerSetup.disableDiagnosticReporting(dbConnection): sets system.config.common.diag = 'none'; writes nothing when it is already 'none' or when there is no system.config object.
  • Called in prepareTests right after disableAdminInstances(), i.e. before the DB backup — every test and every suite starts with it.
  • CI runs are unchanged (the plugin already stops on CI). Only adapters that read diag themselves to decide on sending usage statistics behave differently, and in a test run that is the point.
  • CHANGELOG (WORK IN PROGRESS) updated; build/ rebuilt as in the other commits.

Tests

  • src/tests/integration/lib/controllerSetup.test.ts: sets diag to 'none' and keeps the rest of the object, writes nothing when it is already 'none', writes nothing without system.config.
  • npm run check, npm run lint, npm run build, npm test (62 passing) — all green.
  • End-to-end with a throwaway adapter that declares the sentry plugin, js-controller dev, CI unset: with 6.2.2 the test controller had diag: extended and plugins.sentry.enabled = true; with this change diag: none and plugins.sentry.enabled = false. The adapter log of both runs is identical apart from timestamps and PIDs — no new warning or error.

🤖 Generated with Claude Code

The integration test controller keeps system.config.common.diag at 'extended' from setup, so whether @iobroker/plugin-sentry reports errors of a local test run depends on the plugin state the setup leaves behind. Set diag to 'none' after the controller setup, like @iobroker/dev-server and @iobroker/legacy-testing do; the plugin then stays off. CI runs are unchanged (the plugin already stops on CI).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@GermanBluefox
GermanBluefox merged commit 3e56ada into ioBroker:master Sep 29, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants