Skip to content

Commit

Permalink
feat: distinguish API URL from web app URL
Browse files Browse the repository at this point in the history
  • Loading branch information
guilgaly authored and notdryft committed Sep 20, 2024
1 parent 135299c commit b075138
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class GatlingEnterpriseStartTask extends GatlingEnterpriseDeployTask {
final RunSummary runSummary = enterprisePlugin.startSimulation(gatling.enterprise.simulationName, deploymentInfo, runComment)
logger.lifecycle("""
|Simulation successfully started.
|Reports are available at: ${gatling.enterprise.url.toExternalForm() + runSummary.reportsPath}
|Reports are available at: ${gatling.enterprise.webAppUrl.toExternalForm() + runSummary.reportsPath}
|""".stripMargin())
if (waitForRunEnd) {
SimulationEndResult finishedRun = enterprisePlugin.waitForRunEnd(runSummary)
Expand Down
32 changes: 24 additions & 8 deletions src/main/groovy/io/gatling/gradle/GatlingPluginExtension.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class GatlingPluginExtension {
private String runTitle
private String runDescription
private String packageId
private String url
private String apiUrl
private String webAppUrl
private boolean batchMode
private boolean waitForRunEnd
private String controlPlaneUrl
Expand All @@ -41,12 +42,20 @@ class GatlingPluginExtension {
setBatchMode(batchMode)
}

def setUrl(String url) {
this.url = url
def setApiUrl(String apiUrl) {
this.apiUrl = apiUrl
}

def url(String url) {
setUrl(url)
def apiUrl(String apiUrl) {
setApiUrl(apiUrl)
}

def setWebAppUrl(String webAppUrl) {
this.webAppUrl = webAppUrl
}

def webAppUrl(String webAppUrl) {
setWebAppUrl(webAppUrl)
}

def setSimulationId(String simulationId) {
Expand Down Expand Up @@ -159,8 +168,14 @@ class GatlingPluginExtension {

@Input
@Optional
URL getUrl() {
new URI(ConfigurationConstants.Url.valueOf(url)).toURL()
URL getApiUrl() {
new URI(ConfigurationConstants.ApiUrl.valueOf(apiUrl)).toURL()
}

@Input
@Optional
URL getWebAppUrl() {
new URI(ConfigurationConstants.WebAppUrl.valueOf(webAppUrl)).toURL()
}

@Input
Expand Down Expand Up @@ -221,7 +236,8 @@ class GatlingPluginExtension {
}

return new PluginConfiguration(
getUrl(),
getApiUrl(),
getWebAppUrl(),
apiToken,
getControlPlaneUrl(),
BuildTool.GRADLE,
Expand Down

0 comments on commit b075138

Please sign in to comment.