Skip to content

Commit

Permalink
#74 Add configuration for drone
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Nov 23, 2018
1 parent 94eaf12 commit b95250b
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 16 deletions.
59 changes: 59 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
kind: pipeline
name: default

# Disable default clone
clone:
disable: true

steps:
# This clone step doesn't use "root" user
- name: clone
image: plugins/git:next

# Restore cache of downloaded dependencies
- name: restore-cache
image: drillster/drone-volume-cache
settings:
restore: true
mount:
- .sbt
- .ivy2
volumes: [{name: cache, path: /cache}]

# Run project tests
- name: run-tests
image: thehiveproject/drone-scala-node
commands:
- sbt -Duser.home=$PWD test

# Publish package
- name: publish-package
image: thehiveproject/drone-scala-node
settings:
bintray_user: {from_secret: bintray_user}
bintray_key: {from_secret: bintray_key}
commands:
- mkdir -p .bintray
- echo realm = Bintray API Realm > .bintray/.credentials
- echo host = api.bintray.com >> .bintray/.credentials
- echo user = $PLUGIN_BINTRAY_USER >> .bintray/.credentials
- echo password = $PLUGIN_BINTRAY_KEY >> .bintray/.credentials
- sbt -Duser.home=$PWD publish
# when:
#event: [tag]

# Save external libraries in cache
- name: save-cache
image: drillster/drone-volume-cache
settings:
rebuild: true
mount:
- .sbt
- .ivy2
volumes: [{name: cache, path: /cache}]

volumes:
- name: cache
host:
path: /opt/drone/cache
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

11 changes: 7 additions & 4 deletions test/org/elastic4play/database/DBFindSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scala.concurrent.duration._

import play.api.Application
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.libs.json.{ JsString, Json }
import play.api.libs.json.{ JsNumber, JsString, Json }
import play.api.test.PlaySpecification

import akka.actor.ActorSystem
Expand Down Expand Up @@ -173,14 +173,17 @@ class DBFindSpec extends PlaySpecification with Mockito {
hit.sourceAsString returns doc.toString
val tpe = "some-object"
hit.`type` returns tpe
val version = 12L
hit.version returns version

// val db = mock[DBConfiguration]
// val dbfind = new DBFind(pageSize, keepAlive, db, ec, mat)
// val db = mock[DBConfiguration]
// val dbfind = new DBFind(pageSize, keepAlive, db, ec, mat)
DBUtils.hit2json(hit) must_== (doc +
("_id" JsString(id)) +
("_parent" JsString(parent)) +
("_routing" JsString(routing)) +
("_type" JsString(tpe)))
("_type" JsString(tpe)) +
("_version" -> JsNumber(version)))
}
}
}
2 changes: 0 additions & 2 deletions test/org/elastic4play/services/CreateSrvSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class CreateSrvSpec extends PlaySpecification with Mockito {
"uuidAttribute" "ee0caf69-560b-4453-9bae-72982225e661",
"hashAttribute" "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
"metricAttribute" Json.obj("metric1" 1, "metric2" 2),
"user" "testUser",
"createdAt" "20160620T162845+0200",
"createdBy" "testUser")

Expand Down Expand Up @@ -78,7 +77,6 @@ class CreateSrvSpec extends PlaySpecification with Mockito {
InvalidFormatAttributeError("metricAttribute", model.metricAttribute.format.name, JsonInputValue(Json.obj("metric1" "blah", "metric2" 2))),
UnknownAttributeError("unknownAttribute", JsNumber(1)),
MissingAttributeError("stringAttribute"),
MissingAttributeError("user"),
MissingAttributeError("createdBy"),
UnknownAttributeError("metricAttribute.metric3", JsString("aze")))

Expand Down
1 change: 1 addition & 0 deletions test/org/elastic4play/services/DeleteSrvSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class DeleteSrvSpec extends PlaySpecification with Mockito {
"_id" "42",
"_routing" "42",
"_type" "testModel",
"_version" -> 1,
"textAttribute" "valid text",
"stringAttribute" "valid string",
"dateAttribute" "20160128T175800+0100",
Expand Down
4 changes: 1 addition & 3 deletions test/org/elastic4play/services/UpdateSrvSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.elastic4play.controllers.JsonInputValue
import org.elastic4play.database.DBModify
import org.elastic4play.models.{ EntityDef, ModelDef, AttributeFormat F }
import org.elastic4play.utils.RichFuture
import org.elastic4play.{ AttributeCheckingError, InvalidFormatAttributeError, UnknownAttributeError, UpdateReadOnlyAttributeError }
import org.elastic4play.{ AttributeCheckingError, InvalidFormatAttributeError, UnknownAttributeError }

@RunWith(classOf[JUnitRunner])
class UpdateSrvSpec extends PlaySpecification with Mockito {
Expand Down Expand Up @@ -63,7 +63,6 @@ class UpdateSrvSpec extends PlaySpecification with Mockito {
"metricAttribute" Json.obj("metric1" "blah", "metric2" 2),
"unknownAttribute" 1,
"metricAttribute.metric3" "aze",
"user" "readonly",
"multiAttribute" "single value")

updateSrv.checkAttributes(attrs, model).await must throwA[AttributeCheckingError].like {
Expand All @@ -76,7 +75,6 @@ class UpdateSrvSpec extends PlaySpecification with Mockito {
InvalidFormatAttributeError("hashAttribute", model.hashAttribute.format.name, JsonInputValue(JsString("01ba471-invalid-9c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b"))),
InvalidFormatAttributeError("metricAttribute", model.metricAttribute.format.name, JsonInputValue(Json.obj("metric1" "blah", "metric2" 2))),
UnknownAttributeError("unknownAttribute", JsNumber(1)),
UpdateReadOnlyAttributeError("user"),
InvalidFormatAttributeError("metricAttribute", "number", JsonInputValue(JsString("aze"))),
InvalidFormatAttributeError("multiAttribute", "multi-string", JsonInputValue(JsString("single value"))))
}
Expand Down

0 comments on commit b95250b

Please sign in to comment.