Skip to content

Commit

Permalink
[plugin checker tests] AT-702 IJ-CR-147943 Send each error to AWS SQS…
Browse files Browse the repository at this point in the history
… using the staging URL

GitOrigin-RevId: 0a96df87303901b1271ce5ae2cefa383ff476d77
  • Loading branch information
emrzv authored and intellij-monorepo-bot committed Oct 28, 2024
1 parent 653730c commit b48f11f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ data class MarketplaceEvent(
val pluginId: Int,

/** Eg: FREE*/
val pricingModel: String
val pricingModel: String,

/** Eg: IDE_PERFORMANCE */
val verificationType: String
) {
/** Removes product code from product version */
fun getNumericProductVersion() = productVersion.split("-").last()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.intellij.ide.starter.ide.IdeProductProvider
import com.intellij.ide.starter.junit5.config.KillOutdatedProcesses
import com.intellij.ide.starter.junit5.hyphenateWithClass
import com.intellij.ide.starter.plugins.PluginNotFoundException
import com.intellij.ide.starter.report.Error
import com.intellij.ide.starter.report.ErrorReporterToCI
import com.intellij.ide.starter.runner.CurrentTestMethod
import com.intellij.ide.starter.runner.IDECommandLine
Expand All @@ -21,6 +22,9 @@ import com.intellij.openapi.util.SystemInfo
import com.intellij.tools.ide.performanceTesting.commands.CommandChain
import com.intellij.tools.ide.performanceTesting.commands.exitApp
import com.intellij.tools.ide.util.common.logOutput
import com.intellij.tools.plugin.checker.aws.SqsClientWrapper
import com.intellij.tools.plugin.checker.aws.VerificationMessage
import com.intellij.tools.plugin.checker.aws.VerificationResultType
import com.intellij.tools.plugin.checker.data.TestCases
import com.intellij.tools.plugin.checker.di.initPluginCheckerDI
import com.intellij.tools.plugin.checker.di.teamCityIntelliJPerformanceServer
Expand All @@ -33,6 +37,7 @@ import org.junit.jupiter.api.Timeout
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource
import software.amazon.awssdk.regions.Region.EU_WEST_1
import java.io.File
import java.io.IOException
import java.net.URI
Expand Down Expand Up @@ -234,6 +239,28 @@ class InstallPluginTest {
return testContext
}

private fun reportErrorsToAwsSqs(errors: List<Error>) {
if (!teamCityIntelliJPerformanceServer.isBuildRunningOnCI) return
val sqsClient = SqsClientWrapper("https://sqs.eu-west-1.amazonaws.com/662690535244/dev_performance-verifier_external-services", EU_WEST_1)
val buildUrl = System.getenv("BUILD_URL")
val marketplaceEvent = getMarketplaceEvent()

for (error in errors) {
val message = VerificationMessage(
error.messageText,
VerificationResultType.PROBLEMS,
buildUrl,
System.currentTimeMillis(),
marketplaceEvent.id,
marketplaceEvent.verificationType,
null
)
sqsClient.sendMessage(message)
}

sqsClient.closeClient()
}

@ParameterizedTest
@MethodSource("data")
@Timeout(value = 20, unit = TimeUnit.MINUTES)
Expand All @@ -254,6 +281,7 @@ class InstallPluginTest {
val diff = subtract(errors, errorsWithoutPlugin).toList()

ErrorReporterToCI.reportErrors(ideRunContext, diff)
reportErrorsToAwsSqs(errors)
}
catch (ex: Exception) {
when (ex) {
Expand Down

0 comments on commit b48f11f

Please sign in to comment.