e2e-tests: Rename 'default' to projectName for explicitness
While still keeping a relatively short name for this highly reused value. Preserve a fair enough balance between footprint and meaning. Improve the default test project name accordingly. Change-Id: Id33ada176a0378154224c0e04ac31208c779c943
This commit is contained in:
		
				
					committed by
					
						
						Marco Miller
					
				
			
			
				
	
			
			
			
						parent
						
							b314e7b64a
						
					
				
				
					commit
					1aa49e0fb1
				
			@@ -22,7 +22,7 @@ import scala.concurrent.duration._
 | 
			
		||||
 | 
			
		||||
class CheckNewProjectReplica1 extends GitSimulation {
 | 
			
		||||
  private val data: FeederBuilder = jsonFile(resource).convert(keys).queue
 | 
			
		||||
  private val default = className
 | 
			
		||||
  private val projectName = className
 | 
			
		||||
 | 
			
		||||
  private lazy val replicationDuration = replicationDelay + SecondsPerWeightUnit
 | 
			
		||||
 | 
			
		||||
@@ -30,7 +30,7 @@ class CheckNewProjectReplica1 extends GitSimulation {
 | 
			
		||||
 | 
			
		||||
  override def replaceOverride(in: String): String = {
 | 
			
		||||
    var next = replaceProperty("http_port1", 8081, in)
 | 
			
		||||
    next = replaceKeyWith("_project", default, next)
 | 
			
		||||
    next = replaceKeyWith("_project", projectName, next)
 | 
			
		||||
    super.replaceOverride(next)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -38,8 +38,8 @@ class CheckNewProjectReplica1 extends GitSimulation {
 | 
			
		||||
      .feed(data)
 | 
			
		||||
      .exec(gitRequest)
 | 
			
		||||
 | 
			
		||||
  private val createProject = new CreateProject(default)
 | 
			
		||||
  private val deleteProject = new DeleteProject(default)
 | 
			
		||||
  private val createProject = new CreateProject(projectName)
 | 
			
		||||
  private val deleteProject = new DeleteProject(projectName)
 | 
			
		||||
 | 
			
		||||
  setUp(
 | 
			
		||||
    createProject.test.inject(
 | 
			
		||||
 
 | 
			
		||||
@@ -22,19 +22,19 @@ import scala.concurrent.duration._
 | 
			
		||||
 | 
			
		||||
class CloneUsingBothProtocols extends GitSimulation {
 | 
			
		||||
  private val data: FeederBuilder = jsonFile(resource).convert(keys).queue
 | 
			
		||||
  private val default = className
 | 
			
		||||
  private val projectName = className
 | 
			
		||||
  private val duration = 2
 | 
			
		||||
 | 
			
		||||
  override def replaceOverride(in: String): String = {
 | 
			
		||||
    replaceKeyWith("_project", default, in)
 | 
			
		||||
    replaceKeyWith("_project", projectName, in)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private val test: ScenarioBuilder = scenario(uniqueName)
 | 
			
		||||
      .feed(data)
 | 
			
		||||
      .exec(gitRequest)
 | 
			
		||||
 | 
			
		||||
  private val createProject = new CreateProject(default)
 | 
			
		||||
  private val deleteProject = new DeleteProject(default)
 | 
			
		||||
  private val createProject = new CreateProject(projectName)
 | 
			
		||||
  private val deleteProject = new DeleteProject(projectName)
 | 
			
		||||
 | 
			
		||||
  setUp(
 | 
			
		||||
    createProject.test.inject(
 | 
			
		||||
 
 | 
			
		||||
@@ -28,9 +28,9 @@ class CreateChange extends ProjectSimulation {
 | 
			
		||||
 | 
			
		||||
  override def relativeRuntimeWeight = 2
 | 
			
		||||
 | 
			
		||||
  def this(default: String) {
 | 
			
		||||
  def this(projectName: String) {
 | 
			
		||||
    this()
 | 
			
		||||
    this.default = default
 | 
			
		||||
    this.projectName = projectName
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  val test: ScenarioBuilder = scenario(uniqueName)
 | 
			
		||||
@@ -43,8 +43,8 @@ class CreateChange extends ProjectSimulation {
 | 
			
		||||
        session
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
  private val createProject = new CreateProject(default)
 | 
			
		||||
  private val deleteProject = new DeleteProject(default)
 | 
			
		||||
  private val createProject = new CreateProject(projectName)
 | 
			
		||||
  private val deleteProject = new DeleteProject(projectName)
 | 
			
		||||
  private val deleteChange = new DeleteChange(this)
 | 
			
		||||
 | 
			
		||||
  setUp(
 | 
			
		||||
 
 | 
			
		||||
@@ -21,9 +21,9 @@ import io.gatling.core.structure.ScenarioBuilder
 | 
			
		||||
class CreateProject extends ProjectSimulation {
 | 
			
		||||
  private val data: FeederBuilder = jsonFile(resource).convert(keys).queue
 | 
			
		||||
 | 
			
		||||
  def this(default: String) {
 | 
			
		||||
  def this(projectName: String) {
 | 
			
		||||
    this()
 | 
			
		||||
    this.default = default
 | 
			
		||||
    this.projectName = projectName
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  val test: ScenarioBuilder = scenario(uniqueName)
 | 
			
		||||
 
 | 
			
		||||
@@ -21,9 +21,9 @@ import io.gatling.core.structure.ScenarioBuilder
 | 
			
		||||
class DeleteProject extends ProjectSimulation {
 | 
			
		||||
  private val data: FeederBuilder = jsonFile(resource).convert(keys).queue
 | 
			
		||||
 | 
			
		||||
  def this(default: String) {
 | 
			
		||||
  def this(projectName: String) {
 | 
			
		||||
    this()
 | 
			
		||||
    this.default = default
 | 
			
		||||
    this.projectName = projectName
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  val test: ScenarioBuilder = scenario(uniqueName)
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ import scala.concurrent.duration._
 | 
			
		||||
 | 
			
		||||
class FlushProjectsCache extends CacheFlushSimulation {
 | 
			
		||||
  private val data: FeederBuilder = jsonFile(resource).convert(keys).queue
 | 
			
		||||
  private val default = className
 | 
			
		||||
  private val projectName = className
 | 
			
		||||
 | 
			
		||||
  override def relativeRuntimeWeight = 2
 | 
			
		||||
 | 
			
		||||
@@ -30,10 +30,10 @@ class FlushProjectsCache extends CacheFlushSimulation {
 | 
			
		||||
      .feed(data)
 | 
			
		||||
      .exec(httpRequest)
 | 
			
		||||
 | 
			
		||||
  private val createProject = new CreateProject(default)
 | 
			
		||||
  private val createProject = new CreateProject(projectName)
 | 
			
		||||
  private val getCacheEntriesAfterProject = new GetProjectsCacheEntries(this)
 | 
			
		||||
  private val checkCacheEntriesAfterFlush = new CheckProjectsCacheFlushEntries(this)
 | 
			
		||||
  private val deleteProject = new DeleteProject(default)
 | 
			
		||||
  private val deleteProject = new DeleteProject(projectName)
 | 
			
		||||
 | 
			
		||||
  setUp(
 | 
			
		||||
    createProject.test.inject(
 | 
			
		||||
 
 | 
			
		||||
@@ -15,9 +15,9 @@
 | 
			
		||||
package com.google.gerrit.scenarios
 | 
			
		||||
 | 
			
		||||
class ProjectSimulation extends GerritSimulation {
 | 
			
		||||
  protected var default: String = "project"
 | 
			
		||||
  protected var projectName: String = "defaultTestProject"
 | 
			
		||||
 | 
			
		||||
  override def replaceOverride(in: String): String = {
 | 
			
		||||
    replaceProperty("project", default, in)
 | 
			
		||||
    replaceProperty("project", projectName, in)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -22,12 +22,12 @@ import scala.concurrent.duration._
 | 
			
		||||
 | 
			
		||||
class ReplayRecordsFromFeeder extends GitSimulation {
 | 
			
		||||
  private val data: FeederBuilder = jsonFile(resource).convert(keys).circular
 | 
			
		||||
  private val default = className
 | 
			
		||||
  private val projectName = className
 | 
			
		||||
 | 
			
		||||
  override def relativeRuntimeWeight = 30
 | 
			
		||||
 | 
			
		||||
  override def replaceOverride(in: String): String = {
 | 
			
		||||
    replaceKeyWith("_project", default, in)
 | 
			
		||||
    replaceKeyWith("_project", projectName, in)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private val test: ScenarioBuilder = scenario(uniqueName)
 | 
			
		||||
@@ -36,8 +36,8 @@ class ReplayRecordsFromFeeder extends GitSimulation {
 | 
			
		||||
            .exec(gitRequest)
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
  private val createProject = new CreateProject(default)
 | 
			
		||||
  private val deleteProject = new DeleteProject(default)
 | 
			
		||||
  private val createProject = new CreateProject(projectName)
 | 
			
		||||
  private val deleteProject = new DeleteProject(projectName)
 | 
			
		||||
  private val maxBeforeDelete: Int = maxExecutionTime - deleteProject.maxExecutionTime
 | 
			
		||||
 | 
			
		||||
  setUp(
 | 
			
		||||
 
 | 
			
		||||
@@ -23,8 +23,8 @@ import scala.concurrent.duration._
 | 
			
		||||
 | 
			
		||||
class SubmitChange extends GerritSimulation {
 | 
			
		||||
  private val data: FeederBuilder = jsonFile(resource).convert(keys).queue
 | 
			
		||||
  private val default = className
 | 
			
		||||
  private var createChange = new CreateChange(default)
 | 
			
		||||
  private val projectName = className
 | 
			
		||||
  private var createChange = new CreateChange(projectName)
 | 
			
		||||
 | 
			
		||||
  override def relativeRuntimeWeight = 10
 | 
			
		||||
 | 
			
		||||
@@ -40,9 +40,9 @@ class SubmitChange extends GerritSimulation {
 | 
			
		||||
      })
 | 
			
		||||
      .exec(http(uniqueName).post("${url}${number}/submit"))
 | 
			
		||||
 | 
			
		||||
  private val createProject = new CreateProject(default)
 | 
			
		||||
  private val createProject = new CreateProject(projectName)
 | 
			
		||||
  private val approveChange = new ApproveChange(createChange)
 | 
			
		||||
  private val deleteProject = new DeleteProject(default)
 | 
			
		||||
  private val deleteProject = new DeleteProject(projectName)
 | 
			
		||||
 | 
			
		||||
  setUp(
 | 
			
		||||
    createProject.test.inject(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user