-
Notifications
You must be signed in to change notification settings - Fork 651
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
refactor(tests): fix conflict of variable scope by renaming local variables during upgrade of groovy 3.x #1341
Merged
Conversation
This file contains 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
…iables during upgrade of groovy 3.x While upgrading groovy 3.0.10 and spockframework 2.0-groovy-3.0, encountered the following errors in groovy test compilation of echo-core and echo-notifications modules: ``` startup failed: /echo/echo-core/src/test/groovy/com/netflix/spinnaker/echo/notification/AbstractEventNotificationAgentSpec.groovy: 42: The current scope already contains a variable of the name event @ line 42, column 43. Mock.sendNotifications(*_) >> { notifica ^ 1 error > Task :echo-core:compileTestGroovy FAILED ``` ``` startup failed: /echo/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/GithubNotificationAgentSpec.groovy: 50: The current scope already contains a variable of the name status @ line 50, column 31. github.updateCheck(*_) >> { token, repo, sha, status -> ^ 1 error > Task :echo-notifications:compileTestGroovy FAILED startup failed: /echo/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/GithubNotificationAgentSpec.groovy: 99: The current scope already contains a variable of the name status @ line 99, column 31. github.updateCheck(*_) >> { token, repo, sha, status -> ^ 1 error > Task :echo-notifications:compileTestGroovy FAILED ``` ``` startup failed: /echo/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/GoogleChatNotificationAgentSpec.groovy: 63: The current scope already contains a variable of the name webhookURL @ line 63, column 35. googleChat.sendMessage(*_) >> { webhookURL, message -> ^ /echo/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/GoogleChatNotificationAgentSpec.groovy: 63: The current scope already contains a variable of the name message @ line 63, column 35. googleChat.sendMessage(*_) >> { webhookURL, message -> ^ 2 errors > Task :echo-notifications:compileTestGroovy FAILED > Task :echo-notifications:compileTestGroovy FAILED startup failed: /echo/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/GoogleChatNotificationAgentSpec.groovy: 92: The current scope already contains a variable of the name webhookURL @ line 92, column 35. googleChat.sendMessage(*_) >> { webhookURL, message -> ^ 1 error ``` ``` startup failed: /echo/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/SlackNotificationAgentSpec.groovy: 36: The current scope already contains a variable of the name channel @ line 36, column 30. slack.sendMessage(*_) >> { message, channel, asUser -> ^ 1 error > Task :echo-notifications:compileTestGroovy FAILED > Task :echo-notifications:compileTestGroovy FAILED startup failed: /echo/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/SlackNotificationAgentSpec.groovy: 62: The current scope already contains a variable of the name message @ line 62, column 30. slack.sendMessage(*_) >> { message, channel, asUser -> ^ /echo/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/SlackNotificationAgentSpec.groovy: 62: The current scope already contains a variable of the name channel @ line 62, column 30. slack.sendMessage(*_) >> { message, channel, asUser -> ^ 2 errors startup failed: /echo/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/SlackNotificationAgentSpec.groovy: 91: The current scope already contains a variable of the name channel @ line 91, column 30. slack.sendMessage(*_) >> { message, channel, asUser -> ^ 1 error > Task :echo-notifications:compileTestGroovy FAILED ``` To fix this issue renamed the local variables to avoid the scope confilct with global variables.
dbyron-sf
approved these changes
Sep 21, 2023
j-sandy
added a commit
to j-sandy/echo
that referenced
this pull request
Oct 6, 2023
…iables during upgrade of groovy 3.x Rectification w.r.t variable named `event` in [PR](spinnaker#1341) of AbstractEventNotificationAgentSpec.groovy class.
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.
While upgrading groovy 3.0.10 and spockframework 2.0-groovy-3.0, encountered the following errors in groovy test compilation of echo-core and echo-notifications modules:
To fix this issue renamed the local variables to avoid the scope conflict with global variables.