Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce activationThreshold for New Relic Scaler #3427

Merged

Conversation

pragmaticivan
Copy link
Contributor

@pragmaticivan pragmaticivan commented Jul 26, 2022

Note that the service resource has a random suffix to narrow down the New Relic query so multiple e2e tests can run in parallel. It was helpful for local development but should also be for multiple PRs at the same time.

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • Tests have been added
  • A PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified)
  • A PR is opened to update the documentation on (repo) (if applicable)
  • Changelog has been updated and is aligned with our changelog requirements

Fixes #3244

Relates to #
Doc Change: kedacore/keda-docs#874

@pragmaticivan pragmaticivan changed the title test: migrate new relic tests to go WIP - test: migrate new relic tests to go Jul 26, 2022
@pragmaticivan pragmaticivan force-pushed the feature/migrate-new-relic-tests branch 2 times, most recently from e1d3d27 to 87d2e7b Compare July 27, 2022 01:25
@pragmaticivan
Copy link
Contributor Author

❯ go test -v -tags e2e ./scalers_go/new_relic/new_relic_test.go
=== RUN   TestNewRelicScaler
    new_relic_test.go:186: --- setting up ---
    helper.go:193: deleting namespace new-relic-test-ns
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:180: Creating namespace - new-relic-test-ns
    helper.go:361: Applying template: scaledObjectTemplate
    helper.go:361: Applying template: secretTemplate
    helper.go:361: Applying template: triggerAuthenticationTemplate
    helper.go:361: Applying template: serviceTemplate
    helper.go:361: Applying template: deploymentTemplate
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 1
    new_relic_test.go:212: --- testing activation ---
    helper.go:361: Applying template: lightLoadTemplate
    helper.go:319: Waiting for some time to ensure deployment replica count doesn't change
    new_relic_test.go:219: --- testing scale up ---
    helper.go:361: Applying template: heavyLoadTemplate
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 3
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 3
    new_relic_test.go:227: --- testing scale down ---
    helper.go:388: Deleting template: lightLoadTemplate
    helper.go:388: Deleting template: heavyLoadTemplate
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 3, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 2, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 2, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 2, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 2, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 2, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 2, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 2, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 2, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 2, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 2, Target - 1
    helper.go:261: Waiting for deployment replicas to hit target. Deployment - new-relic-test-deployment, Current  - 1, Target - 1
    helper.go:388: Deleting template: scaledObjectTemplate
    helper.go:388: Deleting template: secretTemplate
    helper.go:388: Deleting template: triggerAuthenticationTemplate
    helper.go:388: Deleting template: serviceTemplate
    helper.go:388: Deleting template: deploymentTemplate
    helper.go:193: deleting namespace new-relic-test-ns
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
    helper.go:206: waiting for namespace new-relic-test-ns deletion
--- PASS: TestNewRelicScaler (300.67s)
PASS
ok  	command-line-arguments	300.996s

@pragmaticivan pragmaticivan changed the title WIP - test: migrate new relic tests to go test: migrate new relic tests to go Jul 27, 2022
@pragmaticivan pragmaticivan marked this pull request as ready for review July 27, 2022 01:29
@pragmaticivan pragmaticivan requested a review from a team as a code owner July 27, 2022 01:29
@pragmaticivan pragmaticivan changed the title test: migrate new relic tests to go test(#3244): migrate new relic tests to go Jul 27, 2022
@JorTurFer
Copy link
Member

JorTurFer commented Jul 30, 2022

/run-e2e relic
Update: You can check the progress here

@JorTurFer
Copy link
Member

JorTurFer commented Aug 3, 2022

Tests are failing because NEWRELIC_REGION is not provided. This variable is optional and has default value 'EU', could you modify the test to maintain this behavior? Typescript test sets the default value if other isn't provided.
Could you rebase your branch too to avoid the conflicts?

@JorTurFer
Copy link
Member

There are also static linter errors to address https://github.com/kedacore/keda/runs/7531987872?check_suite_focus=true
🙏

@zroubalik
Copy link
Member

@pragmaticivan any update on this please? We would like to complete this by the end of the week. So we can ship a new release the next one.

@pragmaticivan pragmaticivan force-pushed the feature/migrate-new-relic-tests branch from 189541e to b037868 Compare August 4, 2022 17:23
Signed-off-by: Ivan Santos <301291+pragmaticivan@users.noreply.github.com>
@pragmaticivan pragmaticivan force-pushed the feature/migrate-new-relic-tests branch from b037868 to fb9d70b Compare August 4, 2022 17:24
@JorTurFer
Copy link
Member

JorTurFer commented Aug 4, 2022

/run-e2e relic
Update: You can check the progress here

Signed-off-by: Ivan Santos <301291+pragmaticivan@users.noreply.github.com>
@JorTurFer
Copy link
Member

JorTurFer commented Aug 4, 2022

/run-e2e relic*
Update: You can check the progress here

Signed-off-by: Ivan Santos <301291+pragmaticivan@users.noreply.github.com>
@v-shenoy
Copy link
Contributor

v-shenoy commented Aug 4, 2022

/run-e2e relic
Update: You can check the progress here

@pragmaticivan
Copy link
Contributor Author

It looks like it's passing now.

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks for this contribution! ❤️

@JorTurFer JorTurFer changed the title test(#3244): migrate new relic tests to go feat: introduce activationThreshold for New Relic Scaler Aug 4, 2022
@JorTurFer JorTurFer enabled auto-merge (squash) August 4, 2022 22:32
@JorTurFer JorTurFer merged commit 07517d8 into kedacore:main Aug 4, 2022
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.

Migrate e2e test for NewRelic to Go
4 participants