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: Added unit tests for Q FeatureDev planning phase #4235

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

kumsmrit
Copy link
Contributor

@kumsmrit kumsmrit commented Apr 4, 2024

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Added unit tests for Q FeatureDev for the plan generation phase

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kumsmrit kumsmrit requested a review from a team as a code owner April 4, 2024 10:49
@@ -28,7 +28,7 @@ class Session(val tabID: String, val project: Project) {
private var _conversationId: String? = null
private var _latestMessage: String = ""
private var task: String = ""
private val proxyClient: FeatureDevClient
var proxyClient: FeatureDevClient
Copy link
Contributor

Choose a reason for hiding this comment

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

this does not need to be made public

just use project.replaceService to stub the client for tests

@@ -9,6 +9,7 @@ import com.intellij.openapi.project.modules
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.testFramework.DisposableRule
import com.intellij.testFramework.replaceService
import org.gradle.internal.impldep.com.amazonaws.ResponseMetadata
Copy link
Contributor

Choose a reason for hiding this comment

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

dont reference gradle shadow libraries

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you please suggest, how to populate responseMetadata then; as I see similar reference in CodeWhisperer and Gumby tests ?

Copy link
Contributor

Choose a reason for hiding this comment

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

software.amazon.awssdk.awscore.util.AwsHeader or declare a const somewhere

they're in codewhisperer and gumby because someone added it and then everyone after copied it


@Test
fun `test new tab opened`() {
val message: IncomingFeatureDevMessage.NewTabCreated = IncomingFeatureDevMessage.NewTabCreated("new-tab-created", tabId)
Copy link
Contributor

Choose a reason for hiding this comment

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

type declaration is not needed

Suggested change
val message: IncomingFeatureDevMessage.NewTabCreated = IncomingFeatureDevMessage.NewTabCreated("new-tab-created", tabId)
val message = IncomingFeatureDevMessage.NewTabCreated("new-tab-created", tabId)

@@ -28,7 +28,7 @@ class Session(val tabID: String, val project: Project) {
private var _conversationId: String? = null
private var _latestMessage: String = ""
private var task: String = ""
private val proxyClient: FeatureDevClient
private var proxyClient: FeatureDevClient
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private var proxyClient: FeatureDevClient
private val proxyClient: FeatureDevClient

@kumsmrit kumsmrit force-pushed the kumsmrit/featureDev-unitTests branch from cc7e2af to 8f1a5b6 Compare April 8, 2024 23:02
@kumsmrit kumsmrit force-pushed the kumsmrit/featureDev-unitTests branch from 8f1a5b6 to f65a06b Compare April 8, 2024 23:31
Copy link

sonarqubecloud bot commented Apr 8, 2024

Quality Gate Passed Quality Gate passed

Issues
16 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@kumsmrit kumsmrit merged commit 4a9a50c into aws:main Apr 9, 2024
10 of 11 checks passed
kumsmrit added a commit to kumsmrit/aws-toolkit-jetbrains that referenced this pull request Apr 16, 2024
* feat: Added unit tests for FeatureDev planning phase
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.

3 participants