Skip to content

Integration in memory tests overhaul - #23288

Merged
kalverra merged 35 commits into
developfrom
integrationInMemoryTestsOverhaul
Aug 5, 2026
Merged

Integration in memory tests overhaul#23288
kalverra merged 35 commits into
developfrom
integrationInMemoryTestsOverhaul

Conversation

@kalverra

@kalverra kalverra commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Big Changes

  • Greatly simplifies the Integration In-Memory Tests, extracting core logic away from the legacy workflows to run only what we need.
    • Also includes various caching, speed, and cost improvements now possible thanks to the simplification.
  • Changes core/store/ to use embedded go string instead of looking for a file. This enables some CI optimizations, and makes sense to me, but could change behavior/intent in ways I'm not sure of. Calling in @jmank88 on this.

Integration In-Memory Tests Improvements

These would run for a long time, were very complex, and burned a lot of money. They've been greatly simplified, made faster, and cheaper.

  • Restructured them to remove legacy e2e-tests workflow that was unnecessarily complex
  • Implemented caching for plugin installations and builds
  • Fixed Go caching and added to general caching flow of the repo
  • Pre-compile + warm caches in a single step to save a little time + a ton of money.

Comparison

Metric Before After Delta % Delta
Duration 28m20s 14m47s -13m33s -47.8%
Cost $4.43 $0.80 -$3.62 -81.8%
octometrics-smartcontractkit-chainlink-comparisons-29449324331-vs-30932098835-event-pull-request

Small Changes

  • Update golangci-lint action + version in CI
  • Linting in core/store/

Comment thread .github/workflows/run-nightly-in-memory-integration-tests.yml Fixed
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@kalverra
kalverra changed the base branch from develop to loopinstallCaching July 31, 2026 11:34
@trunk-io

trunk-io Bot commented Jul 31, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Base automatically changed from loopinstallCaching to develop July 31, 2026 13:09
@kalverra
kalverra marked this pull request as ready for review July 31, 2026 16:34
@kalverra
kalverra requested review from a team as code owners July 31, 2026 16:34
Comment thread core/store/store.go
jmank88
jmank88 previously approved these changes Aug 4, 2026

Copilot AI 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.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.

Suppressed comments (9)

core/store/models/common_test.go:80

  • t.Parallel() inside the subtest uses the range variable test from the outer loop without capturing it. Because subtests can start running after the loop continues, this can cause the wrong test case data to be used and lead to flaky tests.
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			t.Parallel()

core/store/models/common_test.go:141

  • Same loop-variable capture issue with t.Parallel(): rebind test := test inside the loop before starting parallel subtests to avoid races/flakiness.
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			t.Parallel()

core/store/models/common_test.go:226

  • Same loop-variable capture issue with t.Parallel() in subtests: rebind the loop variable before starting the parallel subtest to avoid non-deterministic behavior.
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			t.Parallel()

core/store/models/common_test.go:117

  • Same loop-variable capture issue with t.Parallel(): the subtest closure reads test from the surrounding range loop without rebinding it, which can make the test non-deterministic under parallel execution.
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			t.Parallel()

core/store/models/common_test.go:206

  • Same loop-variable capture issue with t.Parallel() in subtests: the closure uses test from the outer range loop without rebinding it, which can lead to flaky results.
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			t.Parallel()

core/store/database_ddl.go:33

  • Removing the gosec suppression here is likely to reintroduce a gosec warning for SQL string formatting (even though the identifier is validated/escaped). This may break CI linting; keep a targeted //nolint:gosec with justification.
	// PostgreSQL does not support bound parameters for database identifiers.

	_, err = db.ExecContext(ctx, fmt.Sprintf(dropDatabaseSQLFmt, quoted))

core/store/database_ddl.go:44

  • Same as above: fmt.Sprintf-based SQL construction tends to trigger gosec; without a justified //nolint:gosec this can fail linting even though quotePostgresDBName validates/escapes the identifier.
	// PostgreSQL does not support bound parameters for database identifiers.

	_, err = db.ExecContext(ctx, fmt.Sprintf(createDatabaseSQLFmt, quoted))

.github/workflows/integration-in-memory-tests.yml:24

  • The workflow_call input is named/described as a Slack channel ID, but the default fallback uses a channel name (#ccip-testing) and callers may pass #channel as well. Consider clarifying in the description that this accepts either a channel ID or a #channel name, to avoid confusing/misleading callers.
      slack_channel_id:
        description: "Slack channel ID to notify test results"

core/store/store_test.go:15

  • Minor typo in comment: "without depending on on-disk paths" has a duplicated "on".
// insertFixtures must execute the given fixture SQL without depending on
// on-disk paths derived from runtime.Caller, so that pre-compiled binaries

jmank88
jmank88 previously approved these changes Aug 4, 2026
mchain0
mchain0 previously approved these changes Aug 5, 2026
Comment thread .github/workflows/cre-regression-system-tests.yaml
Tofel
Tofel previously approved these changes Aug 5, 2026
@kalverra
kalverra dismissed stale reviews from Tofel and mchain0 via f643e79 August 5, 2026 13:22
@kalverra
kalverra enabled auto-merge August 5, 2026 13:26
@cl-sonarqube-production

Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
5 Security Hotspots
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE SonarQube for IDE

@kalverra
kalverra added this pull request to the merge queue Aug 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 5, 2026
@kalverra
kalverra added this pull request to the merge queue Aug 5, 2026
Merged via the queue into develop with commit f97f486 Aug 5, 2026
205 of 206 checks passed
@kalverra
kalverra deleted the integrationInMemoryTestsOverhaul branch August 5, 2026 14:04
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.

6 participants