Skip to content

Fixes #39913 - Declare observer for test factories - #11338

Open
jakduch wants to merge 1 commit into
theforeman:developfrom
jakduch:fix/39913-test-observer
Open

jakduch wants to merge 1 commit into
theforeman:developfrom
jakduch:fix/39913-test-observer

Conversation

@jakduch

@jakduch jakduch commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Declare observer in the test-only dependency group, with automatic requiring disabled like the existing factory_bot_rails declaration.

Why

Foreman's current factory_bot 5.x test dependency requires observer. Ruby 3.4 moved that library out of its default gems, so the test suite cannot load on newer Ruby even when the application itself boots successfully.

This keeps the existing factory API and production dependency set unchanged. A major factory_bot upgrade is a separate change, not required to fix this missing test dependency.

Reproduction: https://github.com/jakduch/foreman/actions/runs/38786115767/job/116598424745

Testing

  • Ruby 4.0.7 / Ubuntu 26.04 verification now gets past the reproduced observer LoadError: Rubocop, boot, migrations, schema restoration, the targeted Foreman logging tests and standalone factory_bot loading all passed. The full Ruby 4 unit suite is running next; full application compatibility is not claimed by this dependency-only fix.
  • The same integration workflow passed on Ruby 3.0 / Ubuntu 24.04 and Ruby 3.3 / Ubuntu 26.04: Rubocop, boot, schema round trip, standalone factory loading and the logging suite (12 tests, 22 assertions, no failures/errors/skips on each). It includes the independent syslog (Fixes #39912 - Declare the syslog logging dependency #11337), PostgreSQL CI (Fixes #39911 - Match PostgreSQL dump clients in CI #11336), ldap_fluff and safemode prerequisites to reach this test stage. None of those changes or temporary Git overrides are included in this one-line PR.

Tested revision: abfbc57d3b6f1f9ffe71e6774d93d41fc13f141d.

Issue: https://projects.theforeman.org/issues/39913
Related tracking: https://projects.theforeman.org/issues/39910

AI assistance: Codex.

The factory_bot version used by the test suite requires observer, which is no longer a default gem on Ruby 3.4 and newer. Keep this compatibility dependency in the test group.

AI assistance: Codex.
@lzap

lzap commented Oct 16, 2026

Copy link
Copy Markdown
Member

@theforeman/packaging

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants