0

I am currently trying to setup a play scala project buildchain with travis, heroku and coveralls sbt plugin for codecoverage. I have created a clean scala play app with the activator and just added the coveralls plugin and a travis.yml.

When I push my project and trigger the build I get the following exception while travis runs the tests:

[error] c.g.h.h.HtmlPage - Error loading JavaScript from [http://localhost:19001/assets/javascripts/hello.js].
java.io.IOException: Unable to download JavaScript from 'http://localhost:19001/assets/javascripts/hello.js' (status 404).
  at com.gargoylesoftware.htmlunit.html.HtmlPage.loadJavaScriptFromUrl(HtmlPage.java:1106) ~[htmlunit-2.13.jar:2.13]
  at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1039) ~[htmlunit-2.13.jar:2.13]
  at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:409) [htmlunit-2.13.jar:2.13]
  at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:266) [htmlunit-2.13.jar:2.13]
  at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286) [htmlunit-2.13.jar:2.13]

I have found this old topic (https://groups.google.com/forum/#!topic/play-framework/yj4NT3BO0Os) with the same errormessage but unfortunately none of the solutions there worked for me.

Does anyone here use coveralls or know a solution for my problem? I ve attached all configuration files.

build.sbt

import scoverage.ScoverageSbtPlugin.instrumentSettings
import org.scoverage.coveralls.CoverallsPlugin.coverallsSettings

name := """buildchain"""

version := "1.0-SNAPSHOT"

scalaVersion := "2.11.1"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

libraryDependencies ++= Seq(
  jdbc,
  anorm,
  cache,
  ws
)

instrumentSettings

CoverallsPlugin.coverallsSettings

ScoverageKeys.minimumCoverage := 1

ScoverageKeys.failOnMinimumCoverage := true

plugins.sbt:

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

resolvers += Classpaths.sbtPluginReleases

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.5")

// web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.0.0")

// code coverage
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "0.99.7.1")

addSbtPlugin("org.scoverage" %% "sbt-coveralls" % "0.99.0")

travis.yml

language: scala
scala:
  - 2.11.2
script: "sbt coveralls"
notifications:
  email: false
biesior
  • 55,576
  • 10
  • 125
  • 182
MeiSign
  • 1,487
  • 1
  • 15
  • 39

3 Answers3

1

The issue is with sbt-scoverage and has been fixed in release 1.0.0. Please note that you have to update the way you use the plugin, so refer to the setup guide on the readme.

https://github.com/scoverage/sbt-scoverage

sksamuel
  • 16,154
  • 8
  • 60
  • 108
0

The error says you are getting an HTTP 404 (Not Found) error:

java.io.IOException: Unable to download JavaScript from 'http://localhost:19001/assets/javascripts/hello.js' (status 404)

so I'm thinking this isn't so much a problem with your tools but just simply a plain old "not found" issue. Do you have an assets/javascripts/hello.js file in your project?

Reid Spencer
  • 2,776
  • 28
  • 37
  • 1
    Yes I have a hello.js in my assets folder. Its a 100% original scala play app. I think that somehow the routing is not working at that point of time wenn coveralls tries to open the assets files... – MeiSign Oct 22 '14 at 23:40
  • In that case I would suspect routing as well. I noted that you have not utilized the sbt-web plugin. you should have something like: addSbtPlugin("com.typesafe.sbt" % "sbt-web" % "1.1.1") in your plugins.sbt file and with it to add: .enablePlugins(SbtWeb) to your root Project val. – Reid Spencer Oct 22 '14 at 23:46
  • 1
    `PlayScala` is added so it should be enough. Seems more like a problem in integration tests. – Nader Ghanbari Oct 23 '14 at 15:28
0

It seems that this is an issue with the sbt-scoverage plugin and play. I hope that this issue will be resolved in the future...

https://github.com/scoverage/sbt-scoverage/issues/52

MeiSign
  • 1,487
  • 1
  • 15
  • 39