Skip to content

Commit 54795bf

Browse files
committed
fixed integration tests for cassandra backend
1 parent e1e190e commit 54795bf

File tree

5 files changed

+12
-53
lines changed

5 files changed

+12
-53
lines changed

backends/cassandra/build/integration-tests/docker-app.conf

Lines changed: 0 additions & 39 deletions
This file was deleted.

backends/cassandra/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
<configuration>
9696
<environmentVariables>
9797
<HAYSTACK_PROP_CASSANDRA_ENDPOINTS>cass1,cass2</HAYSTACK_PROP_CASSANDRA_ENDPOINTS>
98+
<HAYSTACK_PROP_CASSANDRA_KEYSPACE_AUTO_CREATE_SCHEMA>cassandra_cql_schema_1</HAYSTACK_PROP_CASSANDRA_KEYSPACE_AUTO_CREATE_SCHEMA>
9899
</environmentVariables>
99100
<wildcardSuites>com.expedia.www.haystack.trace.storage.backends.cassandra.unit</wildcardSuites>
100101
</configuration>
@@ -107,8 +108,7 @@
107108
</goals>
108109
<configuration>
109110
<environmentVariables>
110-
<HAYSTACK_OVERRIDES_CONFIG_PATH>/src/reader/build/integration-tests/docker-app.conf
111-
</HAYSTACK_OVERRIDES_CONFIG_PATH>
111+
<HAYSTACK_OVERRIDES_CONFIG_PATH>/src/backends/cassandra/build/integration-tests/docker-app.conf</HAYSTACK_OVERRIDES_CONFIG_PATH>
112112
</environmentVariables>
113113
<wildcardSuites>com.expedia.www.haystack.trace.storage.backends.cassandra.integration</wildcardSuites>
114114
</configuration>

backends/cassandra/src/test/resources/config/base.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ haystack.graphite.host = "monitoring-influxdb-graphite.kube-system.svc"
33
service {
44
port = 8090
55
ssl {
6-
enabled = true
6+
enabled = false
77
cert.path = "/ssl/cert"
88
private.key.path = "/ssl/private-key"
99
}
@@ -44,7 +44,8 @@ cassandra {
4444
keyspace {
4545
name = "haystack"
4646
table.name = "traces"
47-
auto.create.schema = "cassandra_cql_schema_1",
47+
auto.create.schema = "CREATE KEYSPACE IF NOT EXISTS haystack WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor' : 1 } AND durable_writes = false; CREATE TABLE IF NOT EXISTS haystack.traces (id varchar, ts timestamp, spans blob, PRIMARY KEY ((id), ts)) WITH CLUSTERING ORDER BY (ts ASC) AND compaction = { 'class' : 'DateTieredCompactionStrategy', 'max_sstable_age_days': '3' } AND gc_grace_seconds = 86400;"
48+
4849

4950
}
5051
}

backends/cassandra/src/test/scala/com/expedia/www/haystack/trace/storage/backends/cassandra/integration/BaseIntegrationTestSpec.scala

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,19 @@ trait BaseIntegrationTestSpec extends FunSpec with GivenWhenThen with Matchers w
4747
private var cassandraSession: Session = _
4848

4949
override def beforeAll() {
50+
executors.submit(new Runnable {
51+
override def run(): Unit = Service.main(null)
52+
})
53+
//waiting for the service to start up
54+
55+
Thread.sleep(5000)
5056
// setup cassandra
5157
cassandraSession = Cluster
5258
.builder()
5359
.addContactPoints(CASSANDRA_ENDPOINT)
5460
.build()
5561
.connect(CASSANDRA_KEYSPACE)
5662
deleteCassandraTableRows()
57-
58-
59-
60-
executors.submit(new Runnable {
61-
override def run(): Unit = Service.main(null)
62-
})
63-
64-
Thread.sleep(5000)
65-
6663
client = StorageBackendGrpc.newBlockingStub(ManagedChannelBuilder.forAddress("localhost", 8090)
6764
.usePlaintext(true)
6865
.build())

backends/cassandra/src/test/scala/com/expedia/www/haystack/trace/storage/backends/cassandra/unit/config/ConfigurationLoaderSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ConfigurationLoaderSpec extends BaseUnitTestSpec {
2727
it("should load the service config from base.conf") {
2828
val serviceConfig: ServiceConfiguration = project.serviceConfig
2929
serviceConfig.port shouldBe 8090
30-
serviceConfig.ssl.enabled shouldBe true
30+
serviceConfig.ssl.enabled shouldBe false
3131
serviceConfig.ssl.certChainFilePath shouldBe "/ssl/cert"
3232
serviceConfig.ssl.privateKeyPath shouldBe "/ssl/private-key"
3333
}

0 commit comments

Comments
 (0)