Skip to content

ENT-14731: Added tests for cf-reactor - #6430

Merged
larsewi merged 10 commits into
cfengine:masterfrom
victormlg:cf-reactor.MoreTests
Oct 27, 2026
Merged

larsewi merged 10 commits into
cfengine:masterfrom
victormlg:cf-reactor.MoreTests

Conversation

@victormlg

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Victor Moene <victor.moene@northern.tech>
Signed-off-by: Victor Moene <victor.moene@northern.tech>
The check was removed by accident in 9c10ad3. Now it
is reverted back to how it was

Signed-off-by: Victor Moene <victor.moene@northern.tech>
@victormlg
victormlg force-pushed the cf-reactor.MoreTests branch 2 times, most recently from 0a9ecc2 to f9acb68 Compare October 21, 2026 13:53
Comment thread tests/reactor/run.sh Outdated
Comment thread tests/reactor/tests/00_basics/002_classes.cf

@larsewi larsewi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of tests! GJ 🚀

Comment thread tests/reactor/tests/00_basics/002_classes.cf Outdated
Comment thread tests/reactor/tests/00_basics/002_classes.sh Outdated
Comment thread tests/reactor/tests/00_basics/006_identical_events.cf
Comment thread tests/reactor/tests/00_basics/010_then_bundle_list.cf
Comment thread tests/reactor/tests/00_basics/013_then_state_reset.sh Outdated
Comment thread tests/reactor/tests/00_basics/014_persistent_classes.cf Outdated
Comment thread tests/reactor/tests/00_basics/019_override_ifelapsed.cf Outdated
Comment thread tests/reactor/tests/02_then_bundles/003_defaults.cf
Comment thread tests/reactor/tests/02_then_bundles/005_users.cf
@victormlg
victormlg force-pushed the cf-reactor.MoreTests branch from f9acb68 to 8423363 Compare October 26, 2026 13:54
@victormlg

Copy link
Copy Markdown
Contributor Author

@cf-bottom jenkins, please :)

@cf-bottom

Copy link
Copy Markdown

@craigcomstock craigcomstock left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got this far in commit f6c7ea4

Comment thread tests/reactor/lib.sh
Comment thread tests/reactor/tests/00_basics/002_classes.cf
Comment thread tests/reactor/tests/00_basics/002_classes.sh
@craigcomstock
craigcomstock requested review from craigcomstock and removed request for craigcomstock October 26, 2026 21:02
@victormlg
victormlg force-pushed the cf-reactor.MoreTests branch from be0b783 to 44cc789 Compare October 27, 2026 09:52
These tests cover the reactor bundles and the events promise
type.

Signed-off-by: Victor Moene <victor.moene@northern.tech>
Added a folder to cover all event types with test. Starting with file_deleted.

Signed-off-by: Victor Moene <victor.moene@northern.tech>
cf-reactor should parse edit_line bundles so it can use them in the
"then" bundles run on reaction to events

Signed-off-by: Victor Moene <victor.moene@northern.tech>
The promises of edit_line and edit_xml bundles always used
CF_EDIT_IFELAPSED (1 minute) as their ifelapsed, ignoring the default
ifelapsed. cf-reactor sets the default to 0 for the bundles it runs on
events, so a file edited by an event was not edited again by another
event less than a minute later. Edit promises now use the lower of the
two (EDIT_IFELAPSED).

Signed-off-by: Victor Moene <victor.moene@northern.tech>
… event

Signed-off-by: Victor Moene <victor.moene@northern.tech>
If an event promise is guarded by some class, on reaction to
an event, the promise is re-expanded however the class is not
defined anymore. Now, the expanded promise is saved into the
watcher events.

Signed-off-by: Victor Moene <victor.moene@northern.tech>
@victormlg
victormlg force-pushed the cf-reactor.MoreTests branch from 44cc789 to d998880 Compare October 27, 2026 10:00
Since it doesn't actually create users, it doesn't need to be unsafe

Signed-off-by: Victor Moene <victor.moene@northern.tech>
@victormlg
victormlg requested a review from larsewi October 27, 2026 11:22
@larsewi
larsewi merged commit b520fc5 into cfengine:master Oct 27, 2026
13 checks passed
@larsewi

larsewi commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Feel free to continue the review @craigcomstock and we'll make follow-ups. Merging this now to unblock other work.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants