Skip to content
This repository was archived by the owner on May 18, 2020. It is now read-only.

Commit c586dba

Browse files
authored
Rename tests, parallel tests, one elasticsearch replica, readiness probe (#50)
* Rename tests, minor refactor Signed-off-by: Pavol Loffay <ploffay@redhat.com> * Remove unused import Signed-off-by: Pavol Loffay <ploffay@redhat.com> * Add docker service to travis Signed-off-by: Pavol Loffay <ploffay@redhat.com> * Bumb nsenter Signed-off-by: Pavol Loffay <ploffay@redhat.com> * Ignore cassandra test Signed-off-by: Pavol Loffay <ploffay@redhat.com> * Run tests in parallel Signed-off-by: Pavol Loffay <ploffay@redhat.com> * wait fixed time before ES tests Signed-off-by: Pavol Loffay <ploffay@redhat.com> * Increase wait time Signed-off-by: Pavol Loffay <ploffay@redhat.com> * increase memory and CPU for minikube Signed-off-by: Pavol Loffay <ploffay@redhat.com> * restrict ES heap Signed-off-by: Pavol Loffay <ploffay@redhat.com> * increase minimum mem and use newer ES image Signed-off-by: Pavol Loffay <ploffay@redhat.com> * Use one elastic replica Signed-off-by: Pavol Loffay <ploffay@redhat.com> * revert minikube changes Signed-off-by: Pavol Loffay <ploffay@redhat.com> * Remove sleep Signed-off-by: Pavol Loffay <ploffay@redhat.com> * Readiness probe for ES Signed-off-by: Pavol Loffay <ploffay@redhat.com>
1 parent 03ba3e2 commit c586dba

File tree

10 files changed

+49
-17
lines changed

10 files changed

+49
-17
lines changed

.travis.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,34 @@ language: java
55
jdk:
66
- oraclejdk8
77

8+
services:
9+
- docker
10+
811
before_install:
912
# install nsenter which is required for port forwarding
10-
- travis/ubuntu-compile-nsenter.sh && sudo cp .tmp/util-linux-2.24.1/nsenter /usr/bin
13+
- travis/ubuntu-compile-nsenter.sh && sudo cp .tmp/util-linux-2.30.2/nsenter /usr/bin
1114
- travis/install-start-minikube.sh && export PATH=`pwd`:${PATH} # set minikube and kubectl to PATH
1215
- kubectl get all --all-namespaces
1316

1417
cache:
1518
directories:
1619
- $HOME/.m2/repository
1720

18-
script:
19-
- ./mvnw clean verify -Pe2e
21+
install:
22+
# Override default travis to use the maven wrapper
23+
- ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
24+
25+
jobs:
26+
include:
27+
- stage: test
28+
env: [ NAME=all-in-one ]
29+
script: ./mvnw clean verify -Pall-in-one
30+
31+
- env: [ NAME=cassandra ]
32+
script: ./mvnw clean verify -Pcassandra
33+
34+
- env: [ NAME=elasticsearch ]
35+
script: ./mvnw clean verify -Pelasticsearch
2036

2137
after_script:
2238
- docker images --no-trunc=true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ kubernetes cluster (via `kubectl`). When executing tests from IDE make sure that
109109

110110
```bash
111111
minikube start
112-
./mvnw clean verify -Pe2e
112+
./mvnw clean verify -Pcassandra,elasticsearch,all-in-one
113113
```
114114

115115
[ci-img]: https://travis-ci.org/jaegertracing/jaeger-kubernetes.svg?branch=master

all-in-one/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<profiles>
5757
<profile>
58-
<id>e2e</id>
58+
<id>all-in-one</id>
5959
<build>
6060
<plugins>
6161
<plugin>

jaegertracing-kubernetes-deployment-itest/src/main/java/io/jaegertracing/kubernetes/deployment/BaseETest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ public class BaseETest {
6767
@Named(COLLECTOR_SERVICE_NAME)
6868
@PortForward
6969
@ArquillianResource
70-
protected URL collectorUrl;
70+
private URL collectorUrl;
7171

7272
@Port(9411)
7373
@Named(ZIPKIN_SERVICE_NAME)
7474
@PortForward
7575
@ArquillianResource
76-
protected URL zipkinUrl;
76+
private URL zipkinUrl;
7777

7878
@Test
7979
public void testUiResponds() throws IOException, InterruptedException {

production-elasticsearch/jaeger-production-template-with-elasticsearch.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ items:
2424
jaeger-infra: elasticsearch-statefulset
2525
spec:
2626
serviceName: elasticsearch
27-
replicas: 2
27+
replicas: 1
2828
template:
2929
metadata:
3030
labels:
@@ -40,10 +40,23 @@ items:
4040
args:
4141
- "-Ehttp.host=0.0.0.0"
4242
- "-Etransport.host=127.0.0.1"
43-
- "-Ecluster.name=foobar"
4443
volumeMounts:
4544
- name: data
4645
mountPath: /data
46+
readinessProbe:
47+
exec:
48+
command:
49+
- curl
50+
- --fail
51+
- --silent
52+
- --output
53+
- /dev/null
54+
- --user
55+
- elastic:changeme
56+
- localhost:9200
57+
initialDelaySeconds: 5
58+
periodSeconds: 5
59+
timeoutSeconds: 4
4760
volumes:
4861
- name: data
4962
emptyDir: {}

production-elasticsearch/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<profiles>
5757
<profile>
58-
<id>e2e</id>
58+
<id>elasticsearch</id>
5959
<build>
6060
<plugins>
6161
<plugin>

production-elasticsearch/src/test/java/io/jaegertracing/kubernetes/ProductionETest.java renamed to production-elasticsearch/src/test/java/io/jaegertracing/kubernetes/ElasticearchETest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,26 @@
1717
import io.jaegertracing.kubernetes.deployment.BaseETest;
1818
import java.io.IOException;
1919
import java.util.UUID;
20+
import java.util.concurrent.TimeUnit;
2021
import okhttp3.Request;
2122
import okhttp3.Response;
2223
import org.junit.Before;
24+
import org.junit.Ignore;
2325

2426
import static org.awaitility.Awaitility.await;
2527

2628
/**
2729
* @author Pavol Loffay
2830
*/
29-
public class ProductionETest extends BaseETest {
31+
public class ElasticearchETest extends BaseETest {
3032

3133
/**
3234
* We need to initialize ES storage, before we proceed to tests for two reasons:
3335
* 1. sometimes first span is not stored
3436
* 2. jaeger-query returns 500 is ES storage is empty (without indices) https://github.com/jaegertracing/jaeger/issues/464
3537
*/
3638
@Before
37-
public void before() {
39+
public void before() throws InterruptedException {
3840
String serviceName = UUID.randomUUID().toString().replace("-", "");
3941
Tracer tracer = createJaegerTracer(serviceName);
4042
String operationName = UUID.randomUUID().toString().replace("-", "");
@@ -53,6 +55,7 @@ public void before() {
5355
});
5456
}
5557

58+
@Ignore("It requires spark job")
5659
public void testDependencyLinks() throws IOException, InterruptedException {
5760
}
5861
}

production/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<profiles>
5757
<profile>
58-
<id>e2e</id>
58+
<id>cassandra</id>
5959
<build>
6060
<plugins>
6161
<plugin>

production/src/test/java/io/jaegertracing/kubernetes/ProductionETest.java renamed to production/src/test/java/io/jaegertracing/kubernetes/CassandraETest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
/**
2121
* @author Pavol Loffay
2222
*/
23-
public class ProductionETest extends BaseETest {
23+
public class CassandraETest extends BaseETest {
2424

25-
@Ignore("dependency links returns 404 because of old Cassandra image")
25+
@Ignore("It requires spark job")
2626
public void testDependencyLinks() throws IOException, InterruptedException {
2727
}
2828
}

travis/ubuntu-compile-nsenter.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ set -e
1818
sudo apt-get update
1919
sudo apt-get install libncurses5-dev libslang2-dev gettext zlib1g-dev libselinux1-dev debhelper lsb-release pkg-config po-debconf autoconf automake autopoint libtool
2020
mkdir .tmp || true
21-
wget https://www.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-2.24.1.tar.gz -qO - | tar -xz -C .tmp/
22-
cd .tmp/util-linux-2.24.1 && ./autogen.sh && ./configure && make nsenter
21+
wget https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-2.30.2.tar.gz -qO - | tar -xz -C .tmp/
22+
cd .tmp/util-linux-2.30.2 && ./autogen.sh && ./configure && make nsenter
2323

0 commit comments

Comments
 (0)