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

Rename tests, parallel tests, one elasticsearch replica, readiness probe #50

Merged
merged 15 commits into from
Oct 17, 2017
Merged
22 changes: 19 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,34 @@ language: java
jdk:
- oraclejdk8

services:
- docker

before_install:
# install nsenter which is required for port forwarding
- travis/ubuntu-compile-nsenter.sh && sudo cp .tmp/util-linux-2.24.1/nsenter /usr/bin
- travis/ubuntu-compile-nsenter.sh && sudo cp .tmp/util-linux-2.30.2/nsenter /usr/bin
- travis/install-start-minikube.sh && export PATH=`pwd`:${PATH} # set minikube and kubectl to PATH
- kubectl get all --all-namespaces

cache:
directories:
- $HOME/.m2/repository

script:
- ./mvnw clean verify -Pe2e
install:
# Override default travis to use the maven wrapper
- ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V

jobs:
include:
- stage: test
env: [ NAME=all-in-one ]
script: ./mvnw clean verify -Pall-in-one

- env: [ NAME=cassandra ]
script: ./mvnw clean verify -Pcassandra

- env: [ NAME=elasticsearch ]
script: ./mvnw clean verify -Pelasticsearch

after_script:
- docker images --no-trunc=true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ kubernetes cluster (via `kubectl`). When executing tests from IDE make sure that

```bash
minikube start
./mvnw clean verify -Pe2e
./mvnw clean verify -Pcassandra,elasticsearch,all-in-one
Copy link
Collaborator

Choose a reason for hiding this comment

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

ES tests are passing when cassandra tests are disabled.

Should one expect this command to finish successfully, or will this fail as per your comment on the PR ?

Copy link
Member Author

Choose a reason for hiding this comment

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

locally it passes fine, the problem is with travis.

This is a one liner to run everything

```

[ci-img]: https://travis-ci.org/jaegertracing/jaeger-kubernetes.svg?branch=master
Expand Down
2 changes: 1 addition & 1 deletion all-in-one/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<profiles>
<profile>
<id>e2e</id>
<id>all-in-one</id>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ public class BaseETest {
@Named(COLLECTOR_SERVICE_NAME)
@PortForward
@ArquillianResource
protected URL collectorUrl;
private URL collectorUrl;

@Port(9411)
@Named(ZIPKIN_SERVICE_NAME)
@PortForward
@ArquillianResource
protected URL zipkinUrl;
private URL zipkinUrl;

@Test
public void testUiResponds() throws IOException, InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ items:
jaeger-infra: elasticsearch-statefulset
spec:
serviceName: elasticsearch
replicas: 2
replicas: 1
template:
metadata:
labels:
Expand All @@ -40,10 +40,23 @@ items:
args:
- "-Ehttp.host=0.0.0.0"
- "-Etransport.host=127.0.0.1"
- "-Ecluster.name=foobar"
volumeMounts:
- name: data
mountPath: /data
readinessProbe:
exec:
command:
- curl
- --fail
- --silent
- --output
- /dev/null
- --user
- elastic:changeme
- localhost:9200
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 4
volumes:
- name: data
emptyDir: {}
Expand Down
2 changes: 1 addition & 1 deletion production-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<profiles>
<profile>
<id>e2e</id>
<id>elasticsearch</id>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,26 @@
import io.jaegertracing.kubernetes.deployment.BaseETest;
import java.io.IOException;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import okhttp3.Request;
import okhttp3.Response;
import org.junit.Before;
import org.junit.Ignore;

import static org.awaitility.Awaitility.await;

/**
* @author Pavol Loffay
*/
public class ProductionETest extends BaseETest {
public class ElasticearchETest extends BaseETest {

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

@Ignore("It requires spark job")
public void testDependencyLinks() throws IOException, InterruptedException {
}
}
2 changes: 1 addition & 1 deletion production/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<profiles>
<profile>
<id>e2e</id>
<id>cassandra</id>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
/**
* @author Pavol Loffay
*/
public class ProductionETest extends BaseETest {
public class CassandraETest extends BaseETest {

@Ignore("dependency links returns 404 because of old Cassandra image")
@Ignore("It requires spark job")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above: if the only test is being ignored, can't you just remove the whole test class?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, test class extends base test class with other tests.

public void testDependencyLinks() throws IOException, InterruptedException {
}
}
4 changes: 2 additions & 2 deletions travis/ubuntu-compile-nsenter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ set -e
sudo apt-get update
sudo apt-get install libncurses5-dev libslang2-dev gettext zlib1g-dev libselinux1-dev debhelper lsb-release pkg-config po-debconf autoconf automake autopoint libtool
mkdir .tmp || true
wget https://www.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-2.24.1.tar.gz -qO - | tar -xz -C .tmp/
cd .tmp/util-linux-2.24.1 && ./autogen.sh && ./configure && make nsenter
wget https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-2.30.2.tar.gz -qO - | tar -xz -C .tmp/
cd .tmp/util-linux-2.30.2 && ./autogen.sh && ./configure && make nsenter