| # 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: env |
| steps: |
| - name: install yq |
| command: |- |
| BASE_DIR=/tmp/skywalking-infra-e2e |
| BIN_DIR=/usr/local/bin |
| |
| 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 |
| - name: install swctl |
| command: |- |
| BASE_DIR=/tmp/skywalking-infra-e2e |
| BIN_DIR=/usr/local/bin |
| |
| 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 |
| cleanup: |
| # always never success failure |
| on: always |
| |
| trigger: |
| action: http |
| interval: 3s |
| times: 5 |
| url: http://127.0.0.1:${ui_8080}/ |
| method: GET |
| |
| verify: |
| # verify with retry strategy |
| retry: |
| # max retry count |
| count: 20 |
| # the interval between two retries, in millisecond. |
| interval: 3s |
| cases: |
| # service |
| - expected: expected/service.yml |
| query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql browser service ls test-ui |
| # version |
| - expected: expected/version.yml |
| query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql browser version ls --service-name test-ui |
| # page |
| - expected: expected/page.yml |
| query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql browser page ls --service-name test-ui |
| # browser error log |
| - expected: expected/error-log.yml |
| query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql browser logs ls --service-name test-ui --version-name v1.0.0 |
| # browser service metrics |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_pv --service-id dGVzdC11aQ==.1 |yq e 'to_entries' - |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_error_sum --service-id dGVzdC11aQ==.1 |yq e 'to_entries' - |
| # browser version metrics |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_single_version_pv --service-id dGVzdC11aQ==.1 --instance-name v1.0.0 |yq e 'to_entries' - |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_single_version_error_sum --service-id dGVzdC11aQ==.1 --instance-name v1.0.0 |yq e 'to_entries' - |
| # browser page metrics |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_page_pv --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' - |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_page_error_sum --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' - |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_page_js_error_sum --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' - |
| # # browser performance metrics |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_page_dom_analysis_avg --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' - |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_page_dom_ready_avg --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' - |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_page_load_page_avg --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' - |
| - expected: expected/metrics-has-value.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \ |
| --name=browser_app_page_ttl_avg --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' - |
| - expected: expected/metrics-has-value-percentile.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear \ |
| --name=browser_app_page_dom_ready_percentile --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - |
| - expected: expected/metrics-has-value-percentile.yml |
| query: | |
| swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear \ |
| --name=browser_app_page_load_page_percentile --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - |
| # dependency service |
| - expected: expected/dependency.yml |
| query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-id dGVzdC11aTxicm93c2VyPg==.1 |
| # trace |
| - expected: expected/traces.yml |
| query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls |
| - expected: expected/trace-detail.yml |
| 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 'index.html' | tail -n1 | awk -F ' ' '{print $2}') |