diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c33c63c..bb4daa5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,7 +26,7 @@ on: jobs: CI: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest timeout-minutes: 180 strategy: fail-fast: true diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 10de749..72e7771 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -35,13 +35,7 @@ jobs: - uses: actions/setup-java@v1 with: java-version: 8 - - run: | - docker-compose --env-file ./test/e2e/.env -f ./test/e2e/docker-compose.yml run -d user - docker wait $(docker ps -qa --filter Name=e2e_user) - status="$?" - docker-compose -f ./test/e2e/docker-compose.yml logs - if [ $status -eq 0 ]; then - docker cp "$(docker ps -qa --filter Name=e2e_user):/response" ./response - cat ./response - fi - docker-compose -f ./test/e2e/docker-compose.yml kill + - name: Run E2E Tests + uses: apache/skywalking-infra-e2e@cf589b4a0b9f8e6f436f78e9cfd94a1ee5494180 + with: + e2e-file: test/e2e/e2e.yaml diff --git a/lib/skywalking/tracer.lua b/lib/skywalking/tracer.lua index 4becc49..5f0c417 100644 --- a/lib/skywalking/tracer.lua +++ b/lib/skywalking/tracer.lua @@ -103,7 +103,7 @@ function Tracer:finish() if ngx.ctx.exitSpan ~= nil and not ngx.ctx.is_finished then local upstream_status = tonumber(ngx.var.upstream_status) if upstream_status then - Span.tag(ngx.ctx.exitSpan, 'http.status', upstream_status) + Span.tag(ngx.ctx.exitSpan, 'http.status_code', upstream_status) end Span.finish(ngx.ctx.exitSpan, ngx.now() * 1000) ngx.ctx.exitSpan = nil @@ -121,7 +121,7 @@ function Tracer:prepareForReport() end local ngxstatus = ngx.var.status - Span.tag(entrySpan, 'http.status', ngxstatus) + Span.tag(entrySpan, 'http.status_code', ngxstatus) if tonumber(ngxstatus) >= 500 then Span.errorOccurred(entrySpan) end diff --git a/test/e2e/e2e.yaml b/test/e2e/e2e.yaml new file mode 100644 index 0000000..5f048a3 --- /dev/null +++ b/test/e2e/e2e.yaml @@ -0,0 +1,22 @@ +# 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: 20m + init-system-environment: .env \ No newline at end of file diff --git a/test/e2e/user/expected/basic.yaml b/test/e2e/user/expected/basic.yaml index cc0c75a..8d4eae4 100644 --- a/test/e2e/user/expected/basic.yaml +++ b/test/e2e/user/expected/basic.yaml @@ -68,7 +68,7 @@ segmentItems: peer: 'e2e-test-with-mock-collector:upstream_ip:port' skipAnalysis: false tags: - - key: http.status + - key: http.status_code value: '200' - operationName: /info parentSpanId: -1 @@ -86,7 +86,7 @@ segmentItems: value: POST - key: http.params value: 'http://nginx/info' - - key: http.status + - key: http.status_code value: '200' refs: - parentEndpoint: 'POST:/info' @@ -126,7 +126,7 @@ segmentItems: value: GET - key: http.params value: 'http://nginx/suffix' - - key: http.status + - key: http.status_code value: '200' - serviceName: e2e-service-provider segmentSize: ge 1 diff --git a/test/e2e/user/expected/requestId.yaml b/test/e2e/user/expected/requestId.yaml index ee80852..de10741 100644 --- a/test/e2e/user/expected/requestId.yaml +++ b/test/e2e/user/expected/requestId.yaml @@ -31,7 +31,7 @@ segmentItems: peer: 'e2e-test-with-mock-collector:upstream_ip:port' skipAnalysis: false tags: - - key: http.status + - key: http.status_code value: '200' - operationName: /info parentSpanId: -1 @@ -49,7 +49,7 @@ segmentItems: value: POST - key: http.params value: 'http://nginx/info' - - key: http.status + - key: http.status_code value: '200' - serviceName: e2e-service-provider segmentSize: ge 1