Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Merge 3ec2cb7 into 63db9f1
Browse files Browse the repository at this point in the history
  • Loading branch information
ahjohannessen committed Aug 12, 2020
2 parents 63db9f1 + 3ec2cb7 commit 443e3e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
env: AKKA_TEST_TIMEFACTOR=1.5 AKKA_TEST_LOGLEVEL=OFF ES_TEST_ADDRESS_PORT=1114 ES_TEST_HTTP_PORT=2114 ES_TEST_IS_20_SERIES=true
before_install:
- docker pull quay.io/ahjohannessen/eventstore-20.6.0-bionic
- docker run -d --rm --name eventstore-node-20 -p 2114:2113 -p 1114:1113 -e EVENTSTORE_DEV=True -e EVENTSTORE_MEM_DB=True -e EVENTSTORE_ENABLE_EXTERNAL_TCP=True -e EVENTSTORE_RUN_PROJECTIONS=All quay.io/ahjohannessen/eventstore-20.6.0-bionic
- docker run -d --rm --name eventstore-node-20 -p 2114:2113 -p 1114:1113 -e EVENTSTORE_INSECURE=True -e EVENTSTORE_MEM_DB=True -e EVENTSTORE_ENABLE_EXTERNAL_TCP=True -e EVENTSTORE_RUN_PROJECTIONS=All quay.io/ahjohannessen/eventstore-20.6.0-bionic
script:
- sbt test:compile
- travis_retry sbt it:test
Expand All @@ -48,9 +48,9 @@ jobs:
before_install:
- docker pull quay.io/ahjohannessen/eventstore-20.6.0-bionic
- docker network create --subnet=172.18.0.0/16 es-net-20
- docker run -d --rm --name es1 --net=es-net-20 --ip 172.18.0.2 -p 2114:2113 -p 1114:1113 -e EVENTSTORE_DISCOVER_VIA_DNS=False -e EVENTSTORE_GOSSIP_SEED=172.18.0.3:2113,172.18.0.4:2113 -e EVENTSTORE_CLUSTER_SIZE=3 -e EVENTSTORE_INSECURE=True -e EVENTSTORE_DEV=True -e EVENTSTORE_MEM_DB=True -e EVENTSTORE_ENABLE_EXTERNAL_TCP=True quay.io/ahjohannessen/eventstore-20.6.0-bionic
- docker run -d --rm --name es2 --net=es-net-20 --ip 172.18.0.3 -p 2115:2113 -p 1115:1113 -e EVENTSTORE_DISCOVER_VIA_DNS=False -e EVENTSTORE_GOSSIP_SEED=172.18.0.2:2113,172.18.0.4:2113 -e EVENTSTORE_CLUSTER_SIZE=3 -e EVENTSTORE_INSECURE=True -e EVENTSTORE_DEV=True -e EVENTSTORE_MEM_DB=True -e EVENTSTORE_ENABLE_EXTERNAL_TCP=True quay.io/ahjohannessen/eventstore-20.6.0-bionic
- docker run -d --rm --name es3 --net=es-net-20 --ip 172.18.0.4 -p 2116:2113 -p 1116:1113 -e EVENTSTORE_DISCOVER_VIA_DNS=False -e EVENTSTORE_GOSSIP_SEED=172.18.0.2:2113,172.18.0.3:2113 -e EVENTSTORE_CLUSTER_SIZE=3 -e EVENTSTORE_INSECURE=True -e EVENTSTORE_DEV=True -e EVENTSTORE_MEM_DB=True -e EVENTSTORE_ENABLE_EXTERNAL_TCP=True quay.io/ahjohannessen/eventstore-20.6.0-bionic
- docker run -d --rm --name es1 --net=es-net-20 --ip 172.18.0.2 -p 2114:2113 -p 1114:1113 -e EVENTSTORE_DISCOVER_VIA_DNS=False -e EVENTSTORE_GOSSIP_SEED=172.18.0.3:2113,172.18.0.4:2113 -e EVENTSTORE_CLUSTER_SIZE=3 -e EVENTSTORE_INSECURE=True -e EVENTSTORE_MEM_DB=True -e EVENTSTORE_ENABLE_EXTERNAL_TCP=True quay.io/ahjohannessen/eventstore-20.6.0-bionic
- docker run -d --rm --name es2 --net=es-net-20 --ip 172.18.0.3 -p 2115:2113 -p 1115:1113 -e EVENTSTORE_DISCOVER_VIA_DNS=False -e EVENTSTORE_GOSSIP_SEED=172.18.0.2:2113,172.18.0.4:2113 -e EVENTSTORE_CLUSTER_SIZE=3 -e EVENTSTORE_INSECURE=True -e EVENTSTORE_MEM_DB=True -e EVENTSTORE_ENABLE_EXTERNAL_TCP=True quay.io/ahjohannessen/eventstore-20.6.0-bionic
- docker run -d --rm --name es3 --net=es-net-20 --ip 172.18.0.4 -p 2116:2113 -p 1116:1113 -e EVENTSTORE_DISCOVER_VIA_DNS=False -e EVENTSTORE_GOSSIP_SEED=172.18.0.2:2113,172.18.0.3:2113 -e EVENTSTORE_CLUSTER_SIZE=3 -e EVENTSTORE_INSECURE=True -e EVENTSTORE_MEM_DB=True -e EVENTSTORE_ENABLE_EXTERNAL_TCP=True quay.io/ahjohannessen/eventstore-20.6.0-bionic
script:
- sbt test:compile
- travis_retry sbt c:test
Expand Down
25 changes: 20 additions & 5 deletions client/src/test/scala/eventstore/akka/ProjectionsClientITest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,43 @@ import ProjectionsClient.ProjectionStatus._
class ProjectionsClientITest extends AbstractStreamsITest {
sequential

val streamId = s"projections_client_itest_$randomUuid"
val timeout = 20.seconds
val ProjectionCode =
""" fromStream("$users").
s""" fromStream("$streamId").
| when({
| $init : function(state,event){
| $$init : function(state,event){
| return { count : 0 }
| },
| $any : function(state,event){
| $$any : function(state,event){
| state.count += 1
| }
| })
""".stripMargin
val ProjectionCodeWithNoState =
""" fromStream("$users").
s""" fromStream("$streamId").
| when({
| $any : function(state,event){
| $$any : function(state,event){
| return;
| }
| })
""".stripMargin

"the projections client" should {

"init test data" in new TestScope {
val es = EsConnection(system)
def genEventData: EventData = EventData(
"test-type",
eventId = randomUuid,
data = Content("""{"data":"data"}"""),
metadata = Content("""{"metadata":"metadata"}""")
)

es(WriteEvents(EventStream.Id(streamId), List(genEventData, genEventData)))
}


"be able to create a projection" in new TestScope {
val client = new ProjectionsClient(settings, system)
val projectionName = generateProjectionName
Expand Down

0 comments on commit 443e3e8

Please sign in to comment.