Skip to content
Permalink
Browse files

Merge branch 'release-3.1.x'

  • Loading branch information
atooni committed Mar 19, 2020
2 parents 971594a + fe7e120 commit d60f5b5a7f7a147fc1c0e58fb483ebc581c9f795
@@ -5,15 +5,11 @@ sealed trait ExitCode {
}

object ExitCode {
// we use this value in an annotation, so it must be a constant string
private[standalone] final val StringCode_NoCertsRefreshed = "5"

sealed abstract class ExitCodeBase protected (val code: Int) extends ExitCode
final case object Ok extends ExitCodeBase(0)
final case object Error extends ExitCodeBase(1)
final case object InternalError extends ExitCodeBase(2)
final case object InvalidCmdline extends ExitCodeBase(3)
final case object Timeout extends ExitCodeBase(4)
final case object NoCertsRefreshed extends ExitCodeBase(StringCode_NoCertsRefreshed.toInt)

final case object NoCertsRefreshed extends ExitCodeBase(5)
}
@@ -14,7 +14,7 @@ import blended.testsupport.retry.Retry
import blended.testsupport.scalatest.LoggingFreeSpec
import blended.util.logging.Logger
import com.typesafe.config.ConfigFactory
import de.tototec.cmdoption.CmdlineParser
import de.tototec.cmdoption.{CmdOption, CmdlineParser}
import org.scalatest.Matchers
import os.CommandResult

@@ -46,6 +46,13 @@ class ScepClientAppTest extends LoggingFreeSpec with TestFile with Matchers {
assert(ex.errMsg !== None)
}

"hardcoded description contains correct exit code" in {
val anno = classOf[Cmdline].getDeclaredFields()
.flatMap(f => Option(f.getAnnotation(classOf[CmdOption])))
.find(a => a.names().contains("--expect-refresh"))
anno.get.description() should endWith(s" ${ExitCode.NoCertsRefreshed.code}")
}

}

"App should fail with Exception when no config is present" in {
@@ -100,6 +100,8 @@ final class JmsConsumerStage(
private[this] def addConsumer(s : String, c : MessageConsumer) : Unit = {
consumer.put(s, c)
consumerSettings.log.underlying.debug(s"Jms Consumer count of [$name] is [${consumer.size}]")
nextPollRelative = None
pollImmediately.invoke()
}

private[this] def removeConsumer(s : String) : Unit = {
@@ -151,8 +153,16 @@ final class JmsConsumerStage(
1.to(consumerSettings.sessionCount).map(i => s"$id-$i").toList

private var nextPollRelative : Option[FiniteDuration] = None
override protected def nextPoll(): Option[FiniteDuration] =
Some(nextPollRelative.getOrElse(consumerSettings.pollInterval))
override protected def nextPoll(): Option[FiniteDuration] = {
nextPollRelative match {
case None =>
Some(consumerSettings.pollInterval)
case Some(npr) =>
nextPollRelative = None
consumerSettings.log.underlying.debug(s"Overriding next poll interval with [$npr]")
Some(npr)
}
}

private def receive(session : JmsSession) : Try[Option[Message]] = Try {

@@ -1,7 +1,7 @@
import blended.sbt.phoenix.osgi.OsgiConfig
import de.wayofquality.sbt.testlogconfig.TestLogConfig
import de.wayofquality.sbt.testlogconfig.TestLogConfig.autoImport._
import net.bzzt.reproduciblebuilds.ReproducibleBuildsPlugin
//import net.bzzt.reproduciblebuilds.ReproducibleBuildsPlugin
import phoenix.ProjectConfig
import sbt.Keys._
import sbt.Tests.{Group, SubProcess}
@@ -35,7 +35,7 @@ trait ProjectSettings
}
Project(name, file(projectDir.getOrElse(projectName)))
}

private def hasForkAnnotation(clazz: AnalyzedClass): Boolean = {

val c = clazz.api().classApi()
@@ -103,16 +103,12 @@ trait ProjectSettings
forked ++ Seq(combined)
},

) ++
// We need to explicitly load the rb settings again to
// make sure the OSGi package is post-processed:
ReproducibleBuildsPlugin.projectSettings

)
}


override def plugins: Seq[AutoPlugin] = super.plugins ++
Seq(ReproducibleBuildsPlugin) ++
//Seq(ReproducibleBuildsPlugin) ++
Seq(TestLogConfig)

}
@@ -2,6 +2,7 @@ import phoenix.ProjectConfig
import sbt.Keys._
import sbt._
import xerial.sbt.Sonatype
import xerial.sbt.Sonatype.SonatypeKeys._

trait PublishConfig extends ProjectConfig {

@@ -14,6 +15,8 @@ trait PublishConfig extends ProjectConfig {
publishMavenStyle := true,
publishArtifact in Test := false,

sonatypeProfileName := "de.wayofquality",

(for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(System.getenv().get("SONATYPE_PASSWORD"))
@@ -13,7 +13,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.13.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.9")
//addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
// Support for artifact signing with gpg
addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0")
// Export test coveragt to codacy
addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "2.112")

@@ -25,7 +25,7 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.5")
// Scala source code formatter (also used by Scala-IDE/Eclipse)
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.0")
// Strip artifacts to make them more reproducible (same input -> same output, checksum wise)
addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.16")
//addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.16")

// Generate logging config for test execution
addSbtPlugin("de.wayofquality.sbt" % "sbt-testlogconfig" % "0.1.0")

0 comments on commit d60f5b5

Please sign in to comment.
You can’t perform that action at this time.