feat(local-cre): runtime CRE-settings override helper for e2e tests - #23335
Open
prashantkumar1982 wants to merge 9 commits into
Open
feat(local-cre): runtime CRE-settings override helper for e2e tests#23335prashantkumar1982 wants to merge 9 commits into
prashantkumar1982 wants to merge 9 commits into
Conversation
Contributor
|
✅ No conflicts with other open PRs targeting |
prashantkumar1982
force-pushed
the
cre/cresettings-runtime-override
branch
4 times, most recently
from
August 5, 2026 07:29
164879d to
2a3caba
Compare
Add ApplyCRESettings, a test helper that overrides CRE settings on a DON at
runtime — without restarting the topology — by proposing a `cresettings` job
to every node of the DON (applied live via loop.AtomicSettings.Store) and
restoring the pre-test baseline on cleanup. Delivery reuses the existing
deployment changeset (ProposeJobSpec{Template: CRESettings}) + node approval;
overrides are merged onto each DON's boot CL_CRE_SETTINGS baseline and rendered
as a scoped TOML document.
Includes scope-varied smoke tests (global, org, workflow, multi-scope) that
demonstrate apply and explicit/auto cleanup.
See core/scripts/cre/environment/docs/cresettings-runtime-override-proposal.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
prashantkumar1982
force-pushed
the
cre/cresettings-runtime-override
branch
from
August 5, 2026 19:39
2a3caba to
99d3f71
Compare
… into cre/cresettings-runtime-override
… into cre/cresettings-runtime-override
prashantkumar1982
marked this pull request as draft
August 6, 2026 17:17
… into cre/cresettings-runtime-override
prashantkumar1982
marked this pull request as ready for review
August 8, 2026 01:18
jmank88
reviewed
Aug 8, 2026
ApplyCRESettings rebuilds from the boot baseline and replaces any prior override rather than stacking on it, so a second apply from the same test while one is still active would silently drop the first. The single-active guard now refuses that case with a message telling you to call Reset(t) first (or compose scopes in one call). A different concurrent test still gets the run-serially error. Also switch the example test to the functional-options API and update the override README to match the stricter guard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… into cre/cresettings-runtime-override
Use errors.New for the arg-less same-owner guard message (perfsprint), and group chainlink-testing-framework with the other smartcontractkit imports (gci). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
jmank88
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




What
Adds a test helper —
helpers.ApplyCRESettings(t, env, opts...)— that overrides CRE settings on a DON at runtime, without restarting the topology, and restores the pre-test baseline on cleanup. Plus scope-varied smoke tests (global / org / workflow / multi-scope) demonstrating apply and cleanup.Scopes are passed as functional options, each carrying that scope's settings TOML (no scope prefix); compose several in one call to apply them together:
Global,Org(id, …),Owner(id, …),Workflow(id, …), andFromFS(fs.FS)(for on-disk fixtures) are the available options.Why
Today, exercising a settings/flag change in a Local CRE e2e test means tearing down the topology and starting a new one with the flag baked into
CL_CRE_SETTINGS. This lets a test flip settings inline, scoped to that test, and revert automatically — the same delivery path prod uses (thecre-settingsdurable-pipeline job proposed to all nodes).How it works
cresettingsjob: the delegate callsloop.AtomicSettings.Store, which hot-swaps the in-memory settings getter (no restart). Seecore/services/cresettings/delegate.go.ProposeJobSpec{Template: CRESettings}) to propose that job to every worker node of the target DON(s) (bootstrap-gateway DONs have no worker/plugin nodes and are skipped). Nodes auto-approvecresettingsjobs on proposal, so delivery is propose-only.CombineCRESettingsFiles— the same code that produces the compiledsettings.toml— into a scoped TOML doc ([global]/[org.<id>]/[owner.<id>]/[workflow.<id>], string values). Overrides are merged onto each DON's bootCL_CRE_SETTINGSbaseline (eachStorefully replaces the getter, so a bare diff would drop boot settings).t.Cleanupand/or an explicitHandle.Reset(t).Reset(t)first, or compose all scopes in one call.See the usage guide:
core/scripts/cre/environment/docs/cresettings-override-README.md.