Skip to content

Commit

Permalink
verify-pat performance test
Browse files Browse the repository at this point in the history
  • Loading branch information
amvanbaren committed Nov 30, 2022
1 parent cea8434 commit 2bf2dec
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** ******************************************************************************
* Copyright (c) 2022 Precies. Software Ltd and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
* ****************************************************************************** */
package org.eclipse.openvsx

import io.gatling.core.Predef._
import org.eclipse.openvsx.Scenarios._

class RegistryAPIVerifyTokenSimulation extends Simulation {
setUp(verifyTokenScenario().inject(atOnceUsers(users))).protocols(httpProtocol)
}
12 changes: 12 additions & 0 deletions server/src/gatling/scala/org/eclipse/openvsx/Scenarios.scala
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,18 @@ object Scenarios {
}
}

def verifyTokenScenario(): ScenarioBuilder = {
scenario("RegistryAPI: Verify PAT")
.repeat(1000) {
feed(csv("namespaces.csv").circular)
.feed(csv("access-tokens.csv").circular)
.exec(http("RegistryAPI.verifyToken")
.get("""/api/${namespace}/verify-pat?token=${access_token}""")
.headers(headers())
.requestTimeout(3.minutes))
}
}

def extensionQueryScenario(): ScenarioBuilder = {
val buildRequestBody: Expression[String] = session => {
val query = session("query").as[String]
Expand Down
1 change: 1 addition & 0 deletions server/src/gatling/scripts/test-registry-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ cd ../../..
./gradlew --rerun-tasks gatlingRun-org.eclipse.openvsx.RegistryAPIGetFileTargetPlatformSimulation
./gradlew --rerun-tasks gatlingRun-org.eclipse.openvsx.RegistryAPIGetQuerySimulation
./gradlew --rerun-tasks gatlingRun-org.eclipse.openvsx.RegistryAPISearchSimulation
./gradlew --rerun-tasks gatlingRun-org.eclipse.openvsx.RegistryAPIVerifyTokenSimulation
cd src/gatling/scripts

0 comments on commit 2bf2dec

Please sign in to comment.