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

ci: add es in docker to travis #103

Merged
merged 1 commit into from
Mar 23, 2018

Conversation

ahjohannessen
Copy link
Contributor

@ahjohannessen ahjohannessen commented Sep 28, 2017

  • 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.

@ahjohannessen ahjohannessen force-pushed the wip-add-es-docker-to-travis branch 5 times, most recently from 83e5490 to e0974bb Compare September 28, 2017 14:48
@ahjohannessen ahjohannessen force-pushed the wip-add-es-docker-to-travis branch 2 times, most recently from 190f532 to 8bdfa6d Compare March 12, 2018 13:47
@ahjohannessen
Copy link
Contributor Author

@t3hnar WDYT?

@ahjohannessen ahjohannessen force-pushed the wip-add-es-docker-to-travis branch 6 times, most recently from e05a315 to f95331b Compare March 12, 2018 15:55
@ahjohannessen
Copy link
Contributor Author

There are various places that need to account for slowness of CI / ES - You can test it out locally, that should be fine.

@ahjohannessen ahjohannessen force-pushed the wip-add-es-docker-to-travis branch 4 times, most recently from a8f7404 to b40d43f Compare March 12, 2018 17:14
@coveralls
Copy link

coveralls commented Mar 12, 2018

Coverage Status

Coverage remained the same at 81.684% when pulling 3838593 on ahjohannessen:wip-add-es-docker-to-travis into 9f9051a on EventStore:master.

@ahjohannessen ahjohannessen force-pushed the wip-add-es-docker-to-travis branch 10 times, most recently from 71a12a1 to 491bc9f Compare March 13, 2018 12:43
@ahjohannessen ahjohannessen force-pushed the wip-add-es-docker-to-travis branch 3 times, most recently from b6ca9b1 to ebc51b3 Compare March 13, 2018 14:04
.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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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?")
Copy link
Contributor

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 ?

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you explain this?

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you explain this?

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you explain this?

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you explain this?

Copy link
Contributor Author

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

@ahjohannessen
Copy link
Contributor Author

ahjohannessen commented Mar 14, 2018

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

@ahjohannessen ahjohannessen force-pushed the wip-add-es-docker-to-travis branch 6 times, most recently from 99a6f07 to 2b966eb Compare March 14, 2018 09:56
 - 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.
@ahjohannessen
Copy link
Contributor Author

@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)
Copy link
Contributor Author

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.

@ahjohannessen
Copy link
Contributor Author

@t3hnar What is holding you back from merging this?

@t3hnar t3hnar merged commit f68bc3c into EventStore:master Mar 23, 2018
@t3hnar
Copy link
Contributor

t3hnar commented Mar 23, 2018

@ahjohannessen thx for pr!

@ahjohannessen ahjohannessen deleted the wip-add-es-docker-to-travis branch April 20, 2018 18:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants