Skip to content

Commit

Permalink
Merge pull request #475 from cquiroz/SEQNG-547
Browse files Browse the repository at this point in the history
SEQNG-547: Timezone generation bugfix
  • Loading branch information
cquiroz authored Feb 16, 2018
2 parents 9d6d665 + 2dbe091 commit 3720df2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ before_cache:
- find $HOME/.sbt -name "*.lock" -delete
install:
- ". $HOME/.nvm/nvm.sh"
- nvm install stable
- nvm use stable
- nvm install 8.7.0
- nvm use 8.7.0
- npm install jsdom
script:
- sbt headerCheck test:headerCheck scalastyle test
Expand Down
4 changes: 1 addition & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ lazy val edu_gemini_seqexec_web_client = project.in(file("modules/edu.gemini.seq
webpackEmitSourceMaps := false,
emitSourceMaps := false,
// Requires the DOM for tests
// requiresDOM in Test := true,
// Disable tests to speed up builds
test := {},
requiresDOM in Test := true,
// Use yarn as it is faster than npm
useYarn := true,
version in webpack := "3.5.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) 2016-2017 Association of Universities for Research in Astronomy, Inc. (AURA)
// For license information see LICENSE or https://opensource.org/licenses/BSD-3-Clause

package edu.gemini.seqexec.web.client

import org.scalatest.{FlatSpec, Matchers}
import java.time.ZoneId

class TimeZonesSpec extends FlatSpec with Matchers {
"TimeZones" should
"include Santiago" in {
ZoneId.of("America/Santiago") should not be(null)
}
it should "include UTC" in {
ZoneId.of("UTC") should not be(null)
}
it should "include Honolulu" in {
ZoneId.of("Pacific/Honolulu") should not be(null)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SeqexecUIApiRoutes(auth: AuthenticationService, events: (server.EventQueue
case \/-(user) =>
// Log who logged in
// Note that the call to read a remoteAddr may do a DNS lookup
Task.delay(clientLog.info(s"${user.displayName} logged in from <${req.remoteHost.getOrElse("Unknown")}>")) *>
Task.delay(clientLog.info(s"${user.displayName} logged in from ${req.remoteHost.getOrElse("Unknown")}")) *>
// if successful set a cookie
httpAuthentication.loginCookie(user) >>= { cookie => Ok(user).addCookie(cookie) }
case -\/(_) =>
Expand All @@ -88,13 +88,13 @@ class SeqexecUIApiRoutes(auth: AuthenticationService, events: (server.EventQueue
val userName = user.fold(_ => "Anonymous", _.displayName)
// Always return ok
// Use remoteAddr to avoid an expensive DNS lookup
Task.delay(clientLog.info(s"$userName on <${auth.req.remoteAddr.getOrElse("Unknown")}>: ${msg.msg}")) *> Ok()
Task.delay(clientLog.info(s"$userName on ${auth.req.remoteAddr.getOrElse("Unknown")}: ${msg.msg}")) *> Ok()
}

case auth @ POST -> Root / "seqexec" / "start" as user =>
val userName = user.fold(_ => "Anonymous", _.displayName)
// Always return ok
Task.delay(clientLog.info(s"$userName connected from <${auth.req.remoteHost.getOrElse("Unknown")}>")) *> Ok()
Task.delay(clientLog.info(s"$userName connected from ${auth.req.remoteHost.getOrElse("Unknown")}")) *> Ok()

case GET -> Root / "seqexec" / "events" as user =>
// Stream seqexec events to clients and a ping
Expand Down
6 changes: 2 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.2.1")
// Use NPM modules rather than webjars
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.10.0")

resolvers +=
Resolver.sonatypeRepo("snapshots")

addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "0.1.0-SNAPSHOT")
// Generate a custom tzdb
addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "0.1.2")

// Avoids a warning message when starting sbt-git
libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.21"

0 comments on commit 3720df2

Please sign in to comment.