Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: drop beta package descriptor feature, closes HYB-545 #164

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ import java.util.UUID

import scala.util.Try

import io.gatling.plugin.configuration.PackageConfiguration
import io.gatling.sbt.GatlingKeys._
import io.gatling.sbt.settings.gatling.EnterpriseUtils._

import sbt._
import sbt.Keys.{ baseDirectory, streams }
import sbt.Keys.streams

class TaskEnterpriseUpload(config: Configuration, enterprisePackage: TaskEnterprisePackage) extends RecoverEnterprisePluginException(config) {
val uploadEnterprisePackage: InitializeTask[Unit] = Def.task {
Expand All @@ -36,15 +35,7 @@ class TaskEnterpriseUpload(config: Configuration, enterprisePackage: TaskEnterpr
val enterprisePlugin = EnterprisePluginTask.batchEnterprisePluginTask(config).value

Try {
val packageId = Option(PackageConfiguration.loadToJson(baseDirectory.value))
.map { jsonConfig =>
logger.info("Package configuration file detected, applying it.")
val id = enterprisePlugin.uploadPackageConfiguration(jsonConfig).toString
logger.info(s"Package id: $id")
id
}
.getOrElse(settingPackageId)
if (packageId.isEmpty && settingSimulationId.isEmpty) {
if (settingPackageId.isEmpty && settingSimulationId.isEmpty) {
logger.error(
s"""A package ID is required to upload a package on Gatling Enterprise; see https://gatling.io/docs/enterprise/cloud/reference/user/package_conf/ , create a package and copy its ID.
|You can then set your package ID value by passing it with -Dgatling.enterprise.packageId=<packageId>, or add the configuration to your SBT settings, e.g.:
Expand All @@ -56,8 +47,8 @@ class TaskEnterpriseUpload(config: Configuration, enterprisePackage: TaskEnterpr
throw ErrorAlreadyLoggedException
}

if (packageId.nonEmpty) {
val packageUUID = UUID.fromString(packageId)
if (settingPackageId.nonEmpty) {
val packageUUID = UUID.fromString(settingPackageId)
enterprisePlugin.uploadPackage(packageUUID, file)
} else {
val simulationId = UUID.fromString(settingSimulationId)
Expand Down