add e2e test for kafka transporter (#42)
This commit is contained in:
parent
fb5e48438a
commit
fbdfc42b4d
|
|
@ -23,8 +23,16 @@ on:
|
|||
|
||||
jobs:
|
||||
E2E:
|
||||
name: Basic function + gRPC transport(Java8)
|
||||
name: Basic function + ${{ matrix.case.name }} transport(Java8)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
matrix:
|
||||
case:
|
||||
- name: gRPC
|
||||
path: test/e2e/case/grpc/e2e.yaml
|
||||
- name: Kafka
|
||||
path: test/e2e/case/kafka/e2e.yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
|
|
@ -42,7 +50,11 @@ jobs:
|
|||
SW_VERSION=$(./mvnw -q -DforceStdout -N org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version)
|
||||
./mvnw -B package -f ./test/e2e/base/pom.xml -Dsw.version=${SW_VERSION}
|
||||
echo "::endgroup::"
|
||||
- name: Run E2E Tests
|
||||
uses: apache/skywalking-infra-e2e@7d55a252c35bf69f65dc64675a80699dc3c21bde
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
e2e-file: test/e2e/case/base/e2e.yaml
|
||||
go-version: '1.16'
|
||||
- name: Run E2E Tests
|
||||
uses: apache/skywalking-infra-e2e@main
|
||||
with:
|
||||
e2e-file: ${{ matrix.case.path }}
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ plugin.kafka.topic_profiling=${SW_PLUGIN_KAFKA_TOPIC_PROFILINGS:skywalking-profi
|
|||
# Specify which Kafka topic name for the register or heartbeat data of Service Instance to report to.
|
||||
plugin.kafka.topic_management=${SW_PLUGIN_KAFKA_TOPIC_MANAGEMENT:skywalking-managements}
|
||||
# Specify which Kafka topic name for the logging data to report to.
|
||||
plugin.kafka.topic_logging=${SW_PLUGIN_KAFKA_TOPIC_LOGGING:skywalking-logging}
|
||||
plugin.kafka.topic_logging=${SW_PLUGIN_KAFKA_TOPIC_LOGGING:skywalking-logs}
|
||||
# isolate multi OAP server when using same Kafka cluster (final topic name will append namespace before Kafka topics with `-` ).
|
||||
plugin.kafka.namespace=${SW_KAFKA_NAMESPACE:}
|
||||
# Match spring beans with regular expression for the class name. Multiple expressions could be separated by a comma. This only works when `Spring annotation plugin` has been activated.
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ services:
|
|||
build:
|
||||
context: provider
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
ENABLE_KAFKA_REPORTER: "false"
|
||||
expose:
|
||||
- 9090
|
||||
networks:
|
||||
|
|
@ -42,7 +44,7 @@ services:
|
|||
environment:
|
||||
SW_AGENT_NAME: e2e-service-provider
|
||||
SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
|
||||
SW_INSTANCE_NAME: provider1
|
||||
SW_AGENT_INSTANCE_NAME: provider1
|
||||
SW_LOGGING_OUTPUT: CONSOLE
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "nc -zn 127.0.0.1 9090"]
|
||||
|
|
@ -54,15 +56,16 @@ services:
|
|||
build:
|
||||
context: consumer
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
ENABLE_KAFKA_REPORTER: "false"
|
||||
expose:
|
||||
- 9090
|
||||
networks:
|
||||
- e2e
|
||||
environment:
|
||||
PROVIDER_URL: http://provider:9090
|
||||
SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
|
||||
SW_AGENT_NAME: e2e-service-consumer
|
||||
SW_INSTANCE_NAME: consumer1
|
||||
SW_AGENT_INSTANCE_NAME: consumer1
|
||||
SW_LOGGING_OUTPUT: CONSOLE
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "nc -zn 127.0.0.1 9090"]
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@
|
|||
|
||||
FROM skywalking/skywalking-java:latest-java8
|
||||
|
||||
ARG ENABLE_KAFKA_REPORTER
|
||||
|
||||
RUN if [[ "${ENABLE_KAFKA_REPORTER}" == "true" ]]; then cp -rf /skywalking/agent/optional-reporter-plugins/* /skywalking/agent/plugins/ ; fi
|
||||
|
||||
VOLUME /services
|
||||
ADD target/e2e-service-consumer.jar /services/
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@
|
|||
|
||||
FROM skywalking/skywalking-java:latest-java8
|
||||
|
||||
ARG ENABLE_KAFKA_REPORTER
|
||||
|
||||
RUN if [[ "${ENABLE_KAFKA_REPORTER}" == "true" ]]; then cp -rf /skywalking/agent/optional-reporter-plugins/* /skywalking/agent/plugins/ ; fi
|
||||
|
||||
VOLUME /services
|
||||
ADD target/e2e-service-provider.jar /services/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,100 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This file is used to show how to write configuration files and can be used to test.
|
||||
|
||||
setup:
|
||||
env: compose
|
||||
file: docker-compose.yml
|
||||
timeout: 1200
|
||||
steps:
|
||||
- name: install yq
|
||||
command: |
|
||||
if ! command -v yq &> /dev/null; then
|
||||
mkdir -p /tmp/skywalking-infra-e2e/bin && cd /tmp/skywalking-infra-e2e
|
||||
mkdir -p yq && cd yq
|
||||
curl -kLo yq.tar.gz https://github.com/mikefarah/yq/archive/v4.11.1.tar.gz
|
||||
tar -zxf yq.tar.gz --strip=1
|
||||
go install && go build -ldflags -s && mv yq ../bin/yq
|
||||
export PATH="$PATH:/tmp/skywalking-infra-e2e/bin"
|
||||
echo "success to install yq"
|
||||
fi
|
||||
- name: install swctl
|
||||
command: |
|
||||
if ! command -v swctl &> /dev/null; then
|
||||
mkdir -p /tmp/skywalking-infra-e2e/bin && cd /tmp/skywalking-infra-e2e
|
||||
mkdir -p swctl && cd swctl
|
||||
curl -kLo skywalking-cli.tar.gz https://github.com/apache/skywalking-cli/archive/4d1cb83e24ff58988f4aba0daa50259593b11670.tar.gz
|
||||
tar -zxf skywalking-cli.tar.gz --strip=1
|
||||
utype=$(uname | awk '{print tolower($0)}')
|
||||
make $utype && mv bin/swctl-*-$utype-amd64 ../bin/swctl
|
||||
export PATH="$PATH:/tmp/skywalking-infra-e2e/bin"
|
||||
echo "success to install swctl"
|
||||
fi
|
||||
|
||||
cleanup:
|
||||
# always never success failure
|
||||
on: always
|
||||
|
||||
trigger:
|
||||
action: http
|
||||
interval: 3s
|
||||
times: 5
|
||||
url: http://${consumer_host}:${consumer_9090}/info
|
||||
method: POST
|
||||
|
||||
verify:
|
||||
# verify with retry strategy
|
||||
retry:
|
||||
# max retry count
|
||||
count: 20
|
||||
# the interval between two retries, in millisecond.
|
||||
interval: 10000
|
||||
cases:
|
||||
# basic check: service list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
|
||||
expected: expected/service.yml
|
||||
# basic check: service metrics
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service=e2e-service-provider |yq e 'to_entries' -
|
||||
expected: expected/metrics-has-value.yml
|
||||
# basic check: service endpoint
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -)
|
||||
expected: expected/service-endpoint.yml
|
||||
# basic check: service endpoint metrics
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' -
|
||||
expected: expected/metrics-has-value.yml
|
||||
|
||||
# native management: service instance list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider
|
||||
expected: expected/service-instance.yml
|
||||
|
||||
# native jvm: service instance jvm metrics
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name instance_jvm_thread_live_count --instance=provider1 --service=e2e-service-provider |yq e 'to_entries' -
|
||||
expected: expected/metrics-has-value.yml
|
||||
|
||||
# native tracing: trace segment list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls
|
||||
expected: expected/traces-list.yml
|
||||
# native tracing: trace detail
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace $(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls|grep -A 5 'POST:/info'|tail -n1|awk -F ' ' '{print $2}')
|
||||
expected: expected/trace-info-detail.yml
|
||||
|
||||
# native event: event list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql event list --service=e2e-service-provider --instance=provider1
|
||||
expected: expected/event-list.yml
|
||||
|
||||
# native log: logs list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -) --trace-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls|grep -A 5 'POST:/info'|tail -n1|awk -F ' ' '{print $2}')
|
||||
expected: expected/logs-list.yml
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
traces:
|
||||
{{- range .traces }}
|
||||
- segmentid: {{ notEmpty .segmentid }}
|
||||
endpointnames:
|
||||
{{- if eq (index .endpointnames 0) "HikariCP/Connection/getConnection" }}
|
||||
- HikariCP/Connection/getConnection
|
||||
{{- end }}
|
||||
{{- if eq (index .endpointnames 0) "HikariCP/Connection/close" }}
|
||||
- HikariCP/Connection/close
|
||||
{{- end }}
|
||||
{{- if eq (index .endpointnames 0) "H2/JDBI/Statement/execute" }}
|
||||
- H2/JDBI/Statement/execute
|
||||
{{- end}}
|
||||
{{- if eq (index .endpointnames 0) "H2/JDBI/Statement/executeQuery" }}
|
||||
- H2/JDBI/Statement/executeQuery
|
||||
{{- end}}
|
||||
{{- if eq (index .endpointnames 0) "H2/JDBI/PreparedStatement/executeQuery" }}
|
||||
- H2/JDBI/PreparedStatement/executeQuery
|
||||
{{- end }}
|
||||
{{- if eq (index .endpointnames 0) "POST:/info" }}
|
||||
- POST:/info
|
||||
{{- end }}
|
||||
{{- if eq (index .endpointnames 0) "POST:/users" }}
|
||||
- POST:/users
|
||||
{{- end }}
|
||||
duration: {{ ge .duration 0 }}
|
||||
start: "{{ notEmpty .start}}"
|
||||
iserror: false
|
||||
traceids:
|
||||
- {{ (index .traceids 0) }}
|
||||
{{- end }}
|
||||
total: {{ gt .total 0 }}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
events:
|
||||
{{- range .events }}
|
||||
{{- contains .events }}
|
||||
- uuid: {{ notEmpty .uuid }}
|
||||
source:
|
||||
service: e2e-service-provider
|
||||
|
|
@ -24,12 +24,10 @@ events:
|
|||
type: Normal
|
||||
message: Start Java Application
|
||||
parameters:
|
||||
{{- range .parameters }}
|
||||
{{- if eq .key "OPTS"}}
|
||||
{{- contains .parameters }}
|
||||
- key: OPTS
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
starttime: {{ gt .starttime 0 }}
|
||||
endtime: {{ gt .endtime 0 }}
|
||||
{{- end }}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
logs:
|
||||
{{- range .logs }}
|
||||
{{- contains .logs }}
|
||||
- servicename: e2e-service-provider
|
||||
serviceid: {{ b64enc "e2e-service-provider" }}.1
|
||||
serviceinstancename: provider1
|
||||
|
|
@ -27,19 +27,13 @@ logs:
|
|||
content: |
|
||||
{{ notEmpty .content }}
|
||||
tags:
|
||||
{{- range .tags }}
|
||||
{{- if eq .key "level"}}
|
||||
{{- contains .tags }}
|
||||
- key: level
|
||||
value: INFO
|
||||
{{- end }}
|
||||
{{- if eq .key "logger" }}
|
||||
- key: logger
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- if eq .key "thread" }}
|
||||
- key: thread
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
total: {{ gt .total 0 }}
|
||||
|
|
@ -13,9 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- range .}}
|
||||
{{- if eq .name "POST:/info" }}
|
||||
{{- contains .}}
|
||||
- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/info" }}
|
||||
name: POST:/info
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
|
|
@ -15,40 +15,26 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
{{- range .}}
|
||||
{{- contains .}}
|
||||
- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
|
||||
name: {{ notEmpty .name }}
|
||||
attributes:
|
||||
{{- range .attributes }}
|
||||
{{- if eq .name "OS Name" }}
|
||||
{{- contains .attributes }}
|
||||
- name: OS Name
|
||||
value: Linux
|
||||
{{- end }}
|
||||
{{- if eq .name "hostname" }}
|
||||
- name: hostname
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- if eq .name "Process No." }}
|
||||
- name: Process No.
|
||||
value: "1"
|
||||
{{- end }}
|
||||
{{- if eq .name "Start Time" }}
|
||||
- name: Start Time
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- if eq .name "JVM Arguments" }}
|
||||
- name: JVM Arguments
|
||||
value: '{{ notEmpty .value }}'
|
||||
{{- end }}
|
||||
{{- if eq .name "Jar Dependencies" }}
|
||||
- name: Jar Dependencies
|
||||
value: '{{ notEmpty .value }}'
|
||||
{{- end }}
|
||||
{{- if eq .name "ipv4s" }}
|
||||
- name: ipv4s
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
language: JAVA
|
||||
instanceuuid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
|
||||
{{- end}}
|
||||
|
|
@ -14,60 +14,34 @@
|
|||
# limitations under the License.
|
||||
|
||||
spans:
|
||||
{{- range .spans}}
|
||||
{{- contains .spans}}
|
||||
- traceid: {{ notEmpty .traceid }}
|
||||
segmentid: {{ notEmpty .segmentid }}
|
||||
spanid: {{ .spanid }}
|
||||
parentspanid: {{ .parentspanid }}
|
||||
refs:
|
||||
{{- if eq .servicecode "e2e-service-provider" }}
|
||||
{{- range .refs }}
|
||||
- traceid: {{ notEmpty .traceid }}
|
||||
parentsegmentid: {{ notEmpty .parentsegmentid }}
|
||||
parentspanid: 1
|
||||
type: CROSS_PROCESS
|
||||
{{- contains .refs }}
|
||||
- traceid: {{ notEmpty .traceid }}
|
||||
parentsegmentid: {{ notEmpty .parentsegmentid }}
|
||||
parentspanid: 1
|
||||
type: CROSS_PROCESS
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if eq .servicecode "e2e-service-consumer" }}
|
||||
[]
|
||||
{{- end }}
|
||||
servicecode: {{ notEmpty .servicecode }}
|
||||
serviceinstancename: {{ notEmpty .serviceinstancename }}
|
||||
servicecode: "e2e-service-provider"
|
||||
serviceinstancename: "provider1"
|
||||
starttime: {{ gt .starttime 0 }}
|
||||
endtime: {{ gt .endtime 0 }}
|
||||
endpointname:
|
||||
{{- if eq .type "Exit" }}
|
||||
/info
|
||||
{{- end }}
|
||||
{{- if eq .type "Entry" }}
|
||||
POST:/info
|
||||
{{- end }}
|
||||
type: {{ notEmpty .type }}
|
||||
peer:
|
||||
{{- if eq .type "Exit" }}
|
||||
provider:9090
|
||||
{{ else }}
|
||||
""
|
||||
{{- end }}
|
||||
component:
|
||||
{{- if eq .type "Exit" }}
|
||||
SpringRestTemplate
|
||||
{{- end }}
|
||||
{{- if eq .type "Entry" }}
|
||||
Tomcat
|
||||
{{- end }}
|
||||
endpointname: POST:/info
|
||||
type: Entry
|
||||
peer: ""
|
||||
component: Tomcat
|
||||
iserror: false
|
||||
layer: Http
|
||||
tags:
|
||||
{{- range .tags }}
|
||||
{{- if eq .key "http.method" }}
|
||||
{{- contains .tags }}
|
||||
- key: http.method
|
||||
value: POST
|
||||
{{- end }}
|
||||
{{- if eq .key "url" }}
|
||||
- key: url
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
logs: []
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
spans:
|
||||
{{- range .spans}}
|
||||
{{- contains .spans}}
|
||||
- traceid: {{ notEmpty .traceid }}
|
||||
segmentid: {{ notEmpty .segmentid }}
|
||||
spanid: 0
|
||||
|
|
@ -31,15 +31,11 @@ spans:
|
|||
iserror: false
|
||||
layer: Http
|
||||
tags:
|
||||
{{- range .tags }}
|
||||
{{- if eq .key "http.method" }}
|
||||
{{- contains .tags }}
|
||||
- key: http.method
|
||||
value: POST
|
||||
{{- end }}
|
||||
{{- if eq .key "url" }}
|
||||
- key: url
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
logs: []
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
traces:
|
||||
{{- contains .traces }}
|
||||
- segmentid: {{ notEmpty .segmentid }}
|
||||
endpointnames:
|
||||
{{- contains .endpointnames }}
|
||||
- POST:/info
|
||||
{{- end }}
|
||||
duration: {{ ge .duration 0 }}
|
||||
start: "{{ notEmpty .start}}"
|
||||
iserror: false
|
||||
traceids:
|
||||
- {{ (index .traceids 0) }}
|
||||
{{- end }}
|
||||
total: {{ gt .total 0 }}
|
||||
|
|
@ -27,9 +27,6 @@ services:
|
|||
extends:
|
||||
file: ../../base/base-compose.yml
|
||||
service: provider
|
||||
environment:
|
||||
SW_AGENT_INSTANCE_NAME: provider1
|
||||
SW_LOGGING_OUTPUT: CONSOLE
|
||||
ports:
|
||||
- 9090
|
||||
depends_on:
|
||||
|
|
@ -41,8 +38,7 @@ services:
|
|||
file: ../../base/base-compose.yml
|
||||
service: consumer
|
||||
environment:
|
||||
SW_AGENT_INSTANCE_NAME: consumer1
|
||||
SW_LOGGING_OUTPUT: CONSOLE
|
||||
PROVIDER_URL: http://provider:9090
|
||||
ports:
|
||||
- 9090
|
||||
depends_on:
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This file is used to show how to write configuration files and can be used to test.
|
||||
|
||||
setup:
|
||||
env: compose
|
||||
file: docker-compose.yml
|
||||
timeout: 1200
|
||||
init-system-environment: ../../script/env
|
||||
steps:
|
||||
- name: install yq
|
||||
command: bash test/e2e/script/prepare/install.sh yq
|
||||
- name: install swctl
|
||||
command: bash test/e2e/script/prepare/install.sh swctl
|
||||
|
||||
cleanup:
|
||||
# always never success failure
|
||||
on: always
|
||||
|
||||
trigger:
|
||||
action: http
|
||||
interval: 3s
|
||||
times: 5
|
||||
url: http://${consumer_host}:${consumer_9090}/info
|
||||
method: POST
|
||||
|
||||
verify:
|
||||
# verify with retry strategy
|
||||
retry:
|
||||
# max retry count
|
||||
count: 20
|
||||
# the interval between two retries, in millisecond.
|
||||
interval: 10s
|
||||
cases:
|
||||
# basic check: service list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
|
||||
expected: ../expected/service.yml
|
||||
# basic check: service metrics
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service-name=e2e-service-provider |yq e 'to_entries' -
|
||||
expected: ../expected/metrics-has-value.yml
|
||||
# basic check: service endpoint
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider
|
||||
expected: ../expected/service-endpoint.yml
|
||||
# basic check: service endpoint metrics
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name=POST:/info --service-name=e2e-service-provider |yq e 'to_entries' -
|
||||
expected: ../expected/metrics-has-value.yml
|
||||
|
||||
# service instance list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider
|
||||
expected: ../expected/service-instance.yml
|
||||
|
||||
# service instance jvm metrics
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name instance_jvm_thread_live_count --instance-name=provider1 --service-name=e2e-service-provider |yq e 'to_entries' -
|
||||
expected: ../expected/metrics-has-value.yml
|
||||
|
||||
# trace segment list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls
|
||||
expected: ../expected/traces-list.yml
|
||||
# trace detail
|
||||
- query: |
|
||||
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace $( \
|
||||
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \
|
||||
| yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - \
|
||||
)
|
||||
expected: ../expected/trace-info-detail.yml
|
||||
|
||||
# event list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql event list --service-name=e2e-service-provider --instance-name=provider1
|
||||
expected: ../expected/event-list.yml
|
||||
|
||||
# logs list
|
||||
- query: |
|
||||
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \
|
||||
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \
|
||||
| yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' -
|
||||
)
|
||||
expected: ../expected/logs-list.yml
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
version: '2.1'
|
||||
|
||||
services:
|
||||
zookeeper:
|
||||
image: zookeeper:3.4
|
||||
hostname: zookeeper
|
||||
expose:
|
||||
- 2181
|
||||
networks:
|
||||
- e2e
|
||||
environment:
|
||||
- ALLOW_ANONYMOUS_LOGIN=yes
|
||||
healthcheck:
|
||||
test: ["CMD", "sh", "-c", "nc -nz 127.0.0.1 2181"]
|
||||
interval: 5s
|
||||
timeout: 60s
|
||||
retries: 120
|
||||
|
||||
broker-a:
|
||||
image: bitnami/kafka:2.4.1
|
||||
hostname: broker-a
|
||||
expose:
|
||||
- 9092
|
||||
networks:
|
||||
- e2e
|
||||
environment:
|
||||
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||
- KAFKA_BROKER_ID=10
|
||||
- ALLOW_PLAINTEXT_LISTENER=yes
|
||||
depends_on:
|
||||
zookeeper:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "kafka-topics.sh", "--list", "--zookeeper", "zookeeper:2181"]
|
||||
interval: 5s
|
||||
timeout: 60s
|
||||
retries: 120
|
||||
|
||||
broker-b:
|
||||
image: bitnami/kafka:2.4.1
|
||||
hostname: broker-b
|
||||
expose:
|
||||
- 9092
|
||||
networks:
|
||||
- e2e
|
||||
environment:
|
||||
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||
- KAFKA_BROKER_ID=24
|
||||
- ALLOW_PLAINTEXT_LISTENER=yes
|
||||
depends_on:
|
||||
zookeeper:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "kafka-topics.sh", "--list", "--zookeeper", "zookeeper:2181"]
|
||||
interval: 5s
|
||||
timeout: 60s
|
||||
retries: 12
|
||||
|
||||
oap:
|
||||
extends:
|
||||
file: ../../base/base-compose.yml
|
||||
service: oap
|
||||
environment:
|
||||
SW_KAFKA_FETCHER: default
|
||||
SW_KAFKA_FETCHER_ENABLE_NATIVE_PROTO_LOG: "true"
|
||||
SW_KAFKA_FETCHER_SERVERS: broker-a:9092,broker-b:9092
|
||||
SW_KAFKA_FETCHER_PARTITIONS: 2
|
||||
SW_KAFKA_FETCHER_PARTITIONS_FACTOR: 1
|
||||
ports:
|
||||
- 12800
|
||||
depends_on:
|
||||
broker-a:
|
||||
condition: service_healthy
|
||||
broker-b:
|
||||
condition: service_healthy
|
||||
|
||||
kafkaprovider:
|
||||
extends:
|
||||
file: ../../base/base-compose.yml
|
||||
service: provider
|
||||
build:
|
||||
args:
|
||||
ENABLE_KAFKA_REPORTER: "true"
|
||||
environment:
|
||||
SW_KAFKA_BOOTSTRAP_SERVERS: broker-a:9092,broker-b:9092
|
||||
SW_GET_TOPIC_TIMEOUT: 60
|
||||
SW_PLUGIN_KAFKA_TOPIC_LOGGING: skywalking-logs
|
||||
ports:
|
||||
- 9090
|
||||
depends_on:
|
||||
oap:
|
||||
condition: service_healthy
|
||||
|
||||
|
||||
kafkaconsumer:
|
||||
extends:
|
||||
file: ../../base/base-compose.yml
|
||||
service: consumer
|
||||
build:
|
||||
args:
|
||||
ENABLE_KAFKA_REPORTER: "true"
|
||||
environment:
|
||||
SW_KAFKA_BOOTSTRAP_SERVERS: broker-a:9092,broker-b:9092
|
||||
SW_GET_TOPIC_TIMEOUT: 60
|
||||
SW_PLUGIN_KAFKA_TOPIC_LOGGING: skywalking-logs
|
||||
PROVIDER_URL: http://kafkaprovider:9090
|
||||
ports:
|
||||
- 9090
|
||||
depends_on:
|
||||
kafkaprovider:
|
||||
condition: service_healthy
|
||||
|
||||
networks:
|
||||
e2e:
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This file is used to show how to write configuration files and can be used to test.
|
||||
|
||||
setup:
|
||||
env: compose
|
||||
file: docker-compose.yml
|
||||
timeout: 1200
|
||||
init-system-environment: ../../script/env
|
||||
steps:
|
||||
- name: install yq
|
||||
command: bash test/e2e/script/prepare/install.sh yq
|
||||
- name: install swctl
|
||||
command: bash test/e2e/script/prepare/install.sh swctl
|
||||
|
||||
cleanup:
|
||||
# always never success failure
|
||||
on: always
|
||||
|
||||
trigger:
|
||||
action: http
|
||||
interval: 3s
|
||||
times: 5
|
||||
url: http://${kafkaconsumer_host}:${kafkaconsumer_9090}/info
|
||||
method: POST
|
||||
|
||||
verify:
|
||||
# verify with retry strategy
|
||||
retry:
|
||||
# max retry count
|
||||
count: 20
|
||||
# the interval between two retries, in millisecond.
|
||||
interval: 10s
|
||||
cases:
|
||||
# basic check: service list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
|
||||
expected: ../expected/service.yml
|
||||
# basic check: service metrics
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service-name=e2e-service-provider |yq e 'to_entries' -
|
||||
expected: ../expected/metrics-has-value.yml
|
||||
# basic check: service endpoint
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider
|
||||
expected: ../expected/service-endpoint.yml
|
||||
# basic check: service endpoint metrics
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name=POST:/info --service-name=e2e-service-provider |yq e 'to_entries' -
|
||||
expected: ../expected/metrics-has-value.yml
|
||||
|
||||
# service instance list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider
|
||||
expected: ../expected/service-instance.yml
|
||||
|
||||
# service instance jvm metrics
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name instance_jvm_thread_live_count --instance-name=provider1 --service-name=e2e-service-provider |yq e 'to_entries' -
|
||||
expected: ../expected/metrics-has-value.yml
|
||||
|
||||
# trace segment list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls
|
||||
expected: ../expected/traces-list.yml
|
||||
# trace detail
|
||||
- query: |
|
||||
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace $( \
|
||||
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \
|
||||
| yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - \
|
||||
)
|
||||
expected: ../expected/trace-info-detail.yml
|
||||
|
||||
# event list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql event list --service-name=e2e-service-provider --instance-name=provider1
|
||||
expected: ../expected/event-list.yml
|
||||
|
||||
# logs list
|
||||
- query: |
|
||||
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \
|
||||
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \
|
||||
| yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' -
|
||||
)
|
||||
expected: ../expected/logs-list.yml
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
SW_CTL_COMMIT=b90255132f916f53eb90955cc8a6445b03a4bec3
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
BASE_DIR=$1
|
||||
BIN_DIR=$2
|
||||
|
||||
set -ex
|
||||
|
||||
if ! command -v swctl &> /dev/null; then
|
||||
mkdir -p $BASE_DIR/swctl && cd $BASE_DIR/swctl
|
||||
curl -kLo skywalking-cli.tar.gz https://github.com/apache/skywalking-cli/archive/${SW_CTL_COMMIT}.tar.gz
|
||||
tar -zxf skywalking-cli.tar.gz --strip=1
|
||||
utype=$(uname | awk '{print tolower($0)}')
|
||||
make $utype && mv bin/swctl-*-$utype-amd64 $BIN_DIR/swctl
|
||||
fi
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
BASE_DIR=$1
|
||||
BIN_DIR=$2
|
||||
|
||||
if ! command -v yq &> /dev/null; then
|
||||
mkdir -p $BASE_DIR/yq && cd $BASE_DIR/yq
|
||||
curl -kLo yq.tar.gz https://github.com/mikefarah/yq/archive/v4.11.1.tar.gz
|
||||
tar -zxf yq.tar.gz --strip=1
|
||||
go install && go build -ldflags -s && cp yq $BIN_DIR/
|
||||
fi
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
set -ex
|
||||
|
||||
NAME=$1
|
||||
CURRENT_DIR="$(cd "$(dirname $0)"; pwd)"
|
||||
|
||||
# prepare base dir
|
||||
TMP_DIR=/tmp/skywalking-infra-e2e
|
||||
BIN_DIR=/usr/local/bin
|
||||
mkdir -p $TMP_DIR && cd $TMP_DIR
|
||||
|
||||
# execute install
|
||||
bash $CURRENT_DIR/install-$NAME.sh $TMP_DIR $BIN_DIR
|
||||
|
||||
echo "success to install $NAME"
|
||||
Loading…
Reference in New Issue