Skip to content

Commit

Permalink
Set correct branch for ES 4.4 (#1081)
Browse files Browse the repository at this point in the history
* Set correct branch for ES 4.4

Signed-off-by: Pavol Loffay <[email protected]>

* Fix tests

Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay authored Jun 8, 2020
1 parent e48d7d3 commit c920e75
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ KAFKA_NAMESPACE ?= "kafka"
KAFKA_EXAMPLE ?= "https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/0.16.2/examples/kafka/kafka-persistent-single.yaml"
KAFKA_YAML ?= "https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.16.2/strimzi-cluster-operator-0.16.2.yaml"
ES_OPERATOR_NAMESPACE ?= openshift-logging
ES_OPERATOR_BRANCH ?= release-4.3
ES_OPERATOR_BRANCH ?= release-4.4
PROMETHEUS_OPERATOR_TAG ?= v0.39.0
PROMETHEUS_RULES_CRD ?= https://raw.githubusercontent.com/coreos/prometheus-operator/${PROMETHEUS_OPERATOR_TAG}/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
PROMETHEUS_SERVICE_MONITORS_CRD ?= https://raw.githubusercontent.com/coreos/prometheus-operator/${PROMETHEUS_OPERATOR_TAG}/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
Expand Down
10 changes: 10 additions & 0 deletions test/e2e/self_provisioned_elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package e2e
import (
"context"
goctx "context"
"fmt"
"os"
"strings"
"testing"
Expand Down Expand Up @@ -130,6 +131,10 @@ func (suite *SelfProvisionedTestSuite) TestIncreasingReplicas() {
err = e2eutil.WaitForDeployment(t, fw.KubeClient, namespace, jaegerInstanceName+"-query", int(updateQueryCount), retryInterval, timeout)
require.NoError(t, err, "Error waiting for query deployment")

// wait for second ES node to come up
err = e2eutil.WaitForDeployment(t, fw.KubeClient, namespace, esDeploymentName(namespace, jaegerInstanceName, 2), 1, retryInterval, timeout)
require.NoError(t, err, "Error waiting for Elasticsearch deployment")

// Make sure there are 2 ES deployments and wait for them to be available
listOptions := metav1.ListOptions{
LabelSelector: "component=elasticsearch",
Expand Down Expand Up @@ -181,6 +186,11 @@ func (suite *SelfProvisionedTestSuite) TestIncreasingReplicas() {
verifyCollectorImage(jaegerInstanceName, namespace, testOtelCollector)
}

func esDeploymentName(ns, jaegerName string, instances int) string {
nsAndName := strings.ReplaceAll(ns, "-", "") + strings.ReplaceAll(jaegerName, "-", "")
return fmt.Sprintf("elasticsearch-cdm-%s-%d", nsAndName[:36], instances)
}

func changeNodeCount(name string, newESNodeCount int, newCollectorNodeCount, newQueryNodeCount int32) {
jaegerInstance := getJaegerInstance(name, namespace)
jaegerInstance.Spec.Collector.Replicas = &newCollectorNodeCount
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/smoketest.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package e2e

import (
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"net/http"
Expand Down Expand Up @@ -138,8 +137,9 @@ func executeSmokeTest(apiTracesEndpoint, collectorEndpoint string, hasInsecureEn
bodyBytes, err := ioutil.ReadAll(resp.Body)
bodyString := string(bodyBytes)

if !strings.Contains(bodyString, "errors\":null") {
return false, errors.New("query service returns errors: " + bodyString)
// The first requests to newly created ES might fail
if !strings.Contains(bodyString, "errors\":null") && !strings.Contains(bodyString, "all shards failed") {
return false, fmt.Errorf("query service returns errors: %s", bodyString)
}
return strings.Contains(bodyString, tStr), nil
})
Expand Down

0 comments on commit c920e75

Please sign in to comment.