this is my scala code for running gatling test and i ve read the folder it should be in should be marked as scala. i have converted this project to gradle from maven and the code is all fine and all the reports are generating in maven but not in gradle. The code in pic is working fine without any compliation errors in maven but in gradle its showing two errors
1: noOfScenarios-> Too many arguments for constructor
2: setUp-> cannot resolve overload method
Please do provide something. This is my image of errorcode
package performance
import io.gatling.core.Predef._
import scala.language.postfixOps
import com.intuit.karate.gatling.PreDef._
import io.gatling.core.structure.{PopulationBuilder, ScenarioBuilder}
import powerfulseal.PowerfulSeal
import utils.{Parser, Performance}
import scala.collection.mutable
import scala.concurrent.duration._
import scala.collection.JavaConverters._
class PrestoSimulation extends Simulation{
val performanceinstance: Performance = Parser.initalizer()
val chaostesttoggle = System.getProperty("chaostoggle","false")
before{
if(chaostesttoggle.equalsIgnoreCase("true")) {
println("INFO: Running powerfulseal script")
PowerfulSeal.runScript("kubectl apply -f src/main/resources/rbac.yml")
PowerfulSeal.runScript("kubectl apply -f src/main/resources/powerfulseal.yml")
}
}
/**
* Build Dynamic scenarios
* @return
*/
val maxTime: Int = performanceinstance.getMaxTime
def scnList(): mutable.ArraySeq[PopulationBuilder] = {
val noOfScenarios = performanceinstance.getNoOfScenarios
val scnList = new mutable.ArraySeq[PopulationBuilder](noOfScenarios)
var i = 0
val listOfScenarios = performanceinstance.getScenarios
for (scenarioinfo <- listOfScenarios.asScala) {
val tag ="T"+(i+1)
println("Created scenario: "+scenarioinfo.toString)
val scen = scenario(scenarioinfo.getScenarioName)
.exec(karateFeature("classpath:performance/presto.feature",tag))
.inject(rampUsers(scenarioinfo.getNoOfUsers) during (scenarioinfo.getTimeDuration seconds))
scnList(i) = scen
i+=1
}
scnList
}
//this is used to execute scenario
setUp(
scnList: _*
).maxDuration(maxTime.minutes).assertions(global.successfulRequests.percent.gte(100))
after{
if(chaostesttoggle.equalsIgnoreCase("true")) {
println("INFO: Stopping powerfulseal script")
PowerfulSeal.runScript("kubectl delete -f src/main/resources/powerfulseal.yml")
}
}
}
question from:
https://stackoverflow.com/questions/65661537/scala-error-after-maven-to-gradle-conversion 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…