Skip to content

fix(test): unbreak scale_handler_test build after events recorder migration#7808

Merged
wozniakjan merged 1 commit into
kedacore:mainfrom
wozniakjan:fix/scale-handler-test-undefined-record
Jun 1, 2026
Merged

fix(test): unbreak scale_handler_test build after events recorder migration#7808
wozniakjan merged 1 commit into
kedacore:mainfrom
wozniakjan:fix/scale-handler-test-undefined-record

Conversation

@wozniakjan

@wozniakjan wozniakjan commented Jun 1, 2026

Copy link
Copy Markdown
Member

#7755 added two tests

  • TestGetScaledObjectStateRecordsResourceScalerActiveMetric
  • TestGetScaledObjectStateSkipsResourceScalerActiveMetricWithModifiers

Both using record.NewFakeRecorder. In the meantime #7781 migrated this file to the events recorder and dropped the k8s.io/client-go/tools/record import, so the merged result fails to compile with "undefined: record", breaking the unit-test build and Static Checks on main.

…ration

kedacore#7755 added TestGetScaledObjectStateRecordsResourceScalerActiveMetric and
TestGetScaledObjectStateSkipsResourceScalerActiveMetricWithModifiers using
record.NewFakeRecorder. In the meantime kedacore#7781 migrated this file to the
events recorder and dropped the k8s.io/client-go/tools/record import, so
the merged result fails to compile with "undefined: record", breaking the
unit-test build and Static Checks on main.

Use events.NewFakeRecorder, matching the rest of the file and the
events.EventRecorder type of the Recorder/recorder fields.

Signed-off-by: Jan Wozniak <[email protected]>
@wozniakjan wozniakjan requested a review from a team as a code owner June 1, 2026 08:43
@wozniakjan wozniakjan requested a review from Copilot June 1, 2026 08:43
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

Thank you for your contribution! 🙏

Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected.

While you are waiting, make sure to:

  • Add an entry in our changelog in alphabetical order and link related issue
  • Update the documentation, if needed
  • Add unit & e2e tests for your changes
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient.

Learn more about our contribution guide.

@keda-automation keda-automation requested a review from a team June 1, 2026 08:43
@snyk-io

snyk-io Bot commented Jun 1, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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

This PR fixes unit test compilation after the repository’s migration from k8s.io/client-go/tools/record to the newer k8s.io/client-go/tools/events recorder API by updating newly added tests to use the correct fake recorder type.

Changes:

  • Replace record.NewFakeRecorder with events.NewFakeRecorder in two scale handler tests to match the file’s existing imports and the events.EventRecorder-typed fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wozniakjan wozniakjan enabled auto-merge (squash) June 1, 2026 08:56
@wozniakjan wozniakjan merged commit 4e7e459 into kedacore:main Jun 1, 2026
25 checks passed
shcherbak pushed a commit to shcherbak/keda that referenced this pull request Jun 3, 2026
…ration (kedacore#7808)

kedacore#7755 added TestGetScaledObjectStateRecordsResourceScalerActiveMetric and
TestGetScaledObjectStateSkipsResourceScalerActiveMetricWithModifiers using
record.NewFakeRecorder. In the meantime kedacore#7781 migrated this file to the
events recorder and dropped the k8s.io/client-go/tools/record import, so
the merged result fails to compile with "undefined: record", breaking the
unit-test build and Static Checks on main.

Use events.NewFakeRecorder, matching the rest of the file and the
events.EventRecorder type of the Recorder/recorder fields.

Signed-off-by: Jan Wozniak <[email protected]>
Signed-off-by: Yurii Shcherbak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants