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

add smoke test and remove play json from the dependencies #74

Merged
merged 3 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ jobs:
java-version: '11'
distribution: 'adopt'
- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt test
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ libraryDependencies ++= Seq(
"org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test,
"org.asciidoctor" % "asciidoctorj" % "2.5.10",
"com.47deg" %% "github4s" % "0.21.0",
"com.typesafe.play" %% "play-json" % "2.10.1",
)

Global / onChangedBuildSource := ReloadOnSourceChanges
28 changes: 28 additions & 0 deletions test/integration/SmokeTest.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

import org.scalatestplus.play.PlaySpec
import org.scalatestplus.play.guice.GuiceOneServerPerSuite
import play.api.libs.ws.WSClient
import org.scalatest._
import org.scalatestplus.play._

import play.api.test._
import play.api.test.Helpers.{GET => GET_REQUEST, _}
import play.api.Application
import play.api.inject.guice.GuiceApplicationBuilder

class SmokeTest extends PlaySpec with GuiceOneServerPerSuite {

override def fakeApplication(): Application = {
GuiceApplicationBuilder()
.configure(
"accessToken" -> sys.env.get("GITHUB_TOKEN").getOrElse("dummy")
)
.build()
}

"should return some page" in {
val wsClient = app.injector.instanceOf[WSClient]
val response = await(wsClient.url(s"http://localhost:$port/").withVirtualHost("blog.lunatech.com").get())
response.status mustBe OK
}
}