-
Notifications
You must be signed in to change notification settings - Fork 40
ci: add es in docker to travis #103
ci: add es in docker to travis #103
Conversation
83e5490
to
e0974bb
Compare
190f532
to
8bdfa6d
Compare
@t3hnar WDYT? |
e05a315
to
f95331b
Compare
There are various places that need to account for slowness of CI / ES - You can test it out locally, that should be fine. |
a8f7404
to
b40d43f
Compare
71a12a1
to
491bc9f
Compare
b6ca9b1
to
ebc51b3
Compare
.travis.yml
Outdated
before_install: | ||
- docker pull eventstore/eventstore | ||
- docker run -d --rm --name eventstore-node -p 2113:2113 -p 1113:1113 -e EVENTSTORE_STATS_PERIOD_SEC=1200 eventstore/eventstore | ||
- sleep 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this? is this enough ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not need to be there, since ES has started before client has been compiled. Will remove later
@@ -80,7 +83,7 @@ class ReadAllEventsForwardITest extends TestConnection { | |||
preparePosition = position.preparePosition - 1 | |||
) | |||
readAllEventsFailed(wrongPosition, 10) must throwA[ServerErrorException] | |||
} | |||
}.pendingUntilFixed("It seems this behavior has changed in ES?") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it work on you local machine ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, try it out. I do not see similar test in .Net client tests
@@ -15,6 +15,7 @@ class ScavengeITest extends TestConnection { | |||
val probe = TestProbe() | |||
actor.tell(ScavengeDatabase, probe.ref) | |||
|
|||
actor ! ScavengeDatabase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you explain this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is nothing to scavenge ES replies completed instantly, this is to make the test more likely to run into getting the expected error
@@ -51,6 +53,7 @@ class SoftDeleteStreamITest extends TestConnection { | |||
// Long.MaxValue = 9223372036854775807 | |||
writeMetadata("""{"$tb":9223372036854775807,"test":"test"}""") | |||
appendEventToRecreate() | |||
expectNoMessage(100.millis) // Give ES a bit time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you explain this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just me trying fix tests due to slow ES/CI. Will probably remove or replace this with something more deterministic.
@@ -65,6 +68,7 @@ class SoftDeleteStreamITest extends TestConnection { | |||
"allow setting json metadata on empty soft deleted stream and recreate stream not overriding metadata" in new SoftDeleteScope { | |||
deleteStream(hard = false) | |||
writeMetadata("""{"test":"test"}""") | |||
expectNoMessage(100.millis) // Give ES a bit time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you explain this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just me trying fix tests due to slow ES/CI. Same as above
@@ -112,6 +116,7 @@ class SoftDeleteStreamITest extends TestConnection { | |||
def appendEventToRecreate(expVer: ExpectedVersion = ExpectedVersion.Any): EventData = { | |||
val event = newEventData | |||
write(expVer, event) | |||
Thread.sleep(100) // Give ES time - fix this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you explain this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just me trying fix tests due to slow ES/CI. Same as above
Some of the pause code is just added because of frusturations due to tests failing non-derministically, slow CI or slow ES. Will try to start ES in in-memory mode to see if that makes things more stable |
99a6f07
to
2b966eb
Compare
- define travis setup such that we run normal tests on 2.11.x & 2.12.x, and only run integration tests on 2.12.x. - add caching to travis for faster build times. - add docker setup to travis such that it:test can be run. - fix some tests that either were subject to race conditions or failing due to reading es system streams when expecting something else. - add akka time factor & loglevel setting to test config in order to tweak CI.
2b966eb
to
3838593
Compare
@t3hnar I have removed some of the temporary pause code and got Travis CI is green now, using in-memory seems to work better. |
@@ -165,7 +165,7 @@ class EsConnectionITest extends eventstore.util.ActorSpec { | |||
|
|||
"publish stream events" in new TestScope { | |||
val streamId = s"java-publish-$randomUuid" | |||
val publisher = connection.streamPublisher(streamId, null, false, null, false) | |||
def publisher = connection.streamPublisher(streamId, null, false, null, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because publisher
immediately starts talking with ES and it is started as finite, hence it completes before we have written events to ES.
@t3hnar What is holding you back from merging this? |
@ahjohannessen thx for pr! |
define travis matrix such that we
run normal tests on 2.11.x & 2.12.x,
and only run integration tests on
2.12.x.
add docker setup on travis such that
it:test can be run.
fix flaky tests that either were subject
to race conditions or failing due to
reading es system streams when expecting
something else.
add akka time factor setting to test config
in order to tweak CI.