Skip to content

Commit 803d0e8

Browse files
committed
wip
1 parent f55f4cd commit 803d0e8

File tree

4 files changed

+51
-25
lines changed

4 files changed

+51
-25
lines changed

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Scala CI
7+
8+
on:
9+
push:
10+
branches: [ "master" ]
11+
pull_request:
12+
branches: [ "master" ]
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up JDK 11
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '11'
26+
distribution: 'temurin'
27+
cache: 'sbt'
28+
- name: Setup sbt launcher
29+
uses: sbt/setup-sbt@v1
30+
- name: Run tests
31+
run: sbt reload
32+
- name: debug
33+
run: |
34+
unzip -l /home/runner/.cache/coursier/v1/https/repo1.maven.org/maven2/com/clever-cloud/testcontainers-warp10/2.0.0/testcontainers-warp10-2.0.0.jar
35+
# Optional: This step uploads information to the GitHub dependency graph and unblocking Dependabot alerts for the repository
36+
- name: Upload dependency graph
37+
uses: scalacenter/sbt-dependency-submission@ab086b50c947c9774b70f39fc7f6e20ca2706c91

build.sbt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
lazy val testContainersScalaVersion = "0.41.5"
2-
lazy val testContainersWarp10Version = "1.0.8"
1+
lazy val testContainersScalaVersion = "0.43.0"
2+
lazy val testContainersWarp10Version = "2.0.0"
33
lazy val akkaVersion = "2.8.8"
44

55
ThisBuild / semanticdbVersion := "4.12.1"
@@ -8,25 +8,25 @@ credentials += Credentials("GnuPG Key ID", "gpg", "B11C53C05D413713BDD3660FA7B8F
88

99
lazy val root = (project in file(".")).settings(
1010
organization := "com.clever-cloud",
11-
scalaVersion := "2.13.15",
11+
scalaVersion := "2.13.16",
1212
version := "2.1.2",
1313
crossScalaVersions := Seq(scalaVersion.value, "3.6.2"),
1414
name := "testcontainers-scala-warp10",
15-
licenses := List("MIT" -> new URI("https://mit-license.org/").toURL()),
15+
licenses := List("MIT" -> new URI("https://mit-license.org/").toURL),
1616
homepage := Some(url("https://github.com/CleverCloud/testcontainers-scala-warp10")),
1717
resolvers += Resolver.mavenLocal,
1818
resolvers += Resolver.mavenCentral,
1919
libraryDependencies ++= Seq(
2020
"com.dimafeng" %% "testcontainers-scala-core" % testContainersScalaVersion,
2121
"com.clever-cloud" % "testcontainers-warp10" % testContainersWarp10Version,
22-
"net.java.dev.jna" % "jna" % "5.15.0" % Test,
22+
"net.java.dev.jna" % "jna" % "5.17.0" % Test,
2323
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
2424
("com.typesafe.akka" %% "akka-protobuf-v3" % akkaVersion % Test).cross(CrossVersion.for3Use2_13),
2525
("com.typesafe.akka" %% "akka-stream-typed" % akkaVersion % Test).cross(CrossVersion.for3Use2_13),
2626
("com.typesafe.akka" %% "akka-stream" % akkaVersion % Test).cross(CrossVersion.for3Use2_13),
2727
("com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion % Test).cross(CrossVersion.for3Use2_13),
2828
"com.dimafeng" %% "testcontainers-scala-scalatest" % testContainersScalaVersion % Test,
29-
"org.slf4j" % "slf4j-jdk14" % "2.0.16" % Test,
29+
"org.slf4j" % "slf4j-jdk14" % "2.0.17" % Test,
3030
("io.moia" %% "scala-http-client" % "5.2.0" % Test).cross(CrossVersion.for3Use2_13)
3131
),
3232
publishMavenStyle := true,

src/main/scala/com.clevercloud.testcontainers.scala/Warp10Container.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ case class Warp10Container(
4040
}
4141

4242
object Warp10Container {
43-
val defaultTag = "2.7.5"
43+
val defaultTag = "3.4.1-ubuntu-ci"
4444

45-
case class Def(
46-
tag: String,
47-
) extends ContainerDef {
45+
case class Def(tag: String = defaultTag) extends ContainerDef {
4846
override type Container = Warp10Container
4947

5048
override def createContainer(): Warp10Container = {

src/test/scala/com/clevercloud/testcontainers/scala/Warp10ContainerSpecs.scala

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,21 @@ import akka.http.scaladsl.unmarshalling.Unmarshal
88
import io.moia.scalaHttpClient._
99
import org.scalatest.concurrent.Eventually
1010
import org.scalatest.matchers.should.Matchers
11-
import org.scalatest.time.{ Milliseconds, Seconds, Span }
1211
import org.scalatest.wordspec.AnyWordSpec
1312
import com.dimafeng.testcontainers.ForAllTestContainer
14-
1513
import java.time.Clock
1614
import scala.concurrent.{ Await, ExecutionContextExecutor, Future }
1715
import scala.concurrent.duration.{ Deadline, DurationInt }
1816

19-
20-
class Warp10ContainerSpecs extends AnyWordSpec
21-
with Matchers
22-
with Eventually
23-
with ForAllTestContainer {
24-
17+
class Warp10ContainerSpecs extends AnyWordSpec with Matchers with Eventually with ForAllTestContainer {
2518

2619
private val Warp10AuthHeader = "X-Warp10-Token"
2720
private val Warp10FetchAPI = "/api/v0/exec"
2821
private val Warp10FetchGTS = "[ '%s' 'test' {} NOW -1 ] FETCH"
2922
private val Warp10FetchedHeader = "X-Warp10-Fetched"
3023
private val Warp10GTS = "1// test{} 42"
3124
private val Warp10UpdateAPI = "/api/v0/update"
32-
private val Warp10Version = "2.7.5"
25+
private val Warp10Version = "3.4.1-ubuntu-ci"
3326

3427
val container: Warp10Container = Warp10Container(Warp10Version)
3528

@@ -39,29 +32,27 @@ class Warp10ContainerSpecs extends AnyWordSpec
3932
implicit val ec : ExecutionContextExecutor = system.executionContext
4033

4134
"warp10 testcontainer" should {
35+
4236
"give write token" in {
4337
container.container.isRunning shouldBe (true)
4438

4539
assert(container.readToken != null)
4640
assert(container.writeToken != null)
4741
}
48-
"write to and read from warp10" in {
49-
implicit val patienceConfig: PatienceConfig = PatienceConfig(timeout = Span(5, Seconds), interval = Span(50, Milliseconds))
5042

43+
"write to and read from warp10" in {
5144
Await.result(warp10Request(container, Warp10UpdateAPI, Warp10GTS, Some(container.writeToken)), 10.seconds) match {
5245
case HttpClientSuccess(_) =>
5346
Await.result(warp10Request(container, Warp10FetchAPI, String.format(Warp10FetchGTS, container.readToken), None), 5.seconds) match {
5447
case HttpClientSuccess(content) =>
5548
content.status.isSuccess() shouldBe (true)
5649
content.headers.find(_.lowercaseName() == Warp10FetchedHeader.toLowerCase()).map(_.value().toInt).getOrElse(0) shouldBe (1)
57-
case _ =>
58-
assert(false)
50+
case _ => assert(false)
5951
}
6052
case DomainError(content) =>
6153
val result = Await.result(Unmarshal(content).to[String], 10.seconds)
6254
assert(false, result)
63-
case _ =>
64-
assert(false)
55+
case _ => assert(false)
6556
}
6657
}
6758
}

0 commit comments

Comments
 (0)