-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add E2E coverage for Trace and Logging #199
Merged
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cbd8de5
Feature e2e coverage
Superskyyy 274051c
Fix action name
Superskyyy 52a7942
add retention period, fix naming
Superskyyy 339f7d7
Refactor CI flow to enable conditional runs
Superskyyy 3f8dd08
Fix filter not checkedout
Superskyyy fa72b78
Enhance CI
Superskyyy ca209fb
Enhance CI
Superskyyy eb4faef
Fix operator and intentional skip
Superskyyy 7d2cd9b
Fix operator and intentional skip
Superskyyy 225fd2a
Refactor CI flow
Superskyyy b77a693
Remove intentional failure
Superskyyy b4248f5
Fix missing dependency
Superskyyy acf5cc0
Enhance styling
Superskyyy b961de3
Remove unused file filter
Superskyyy b2c1900
Fix CI and setups
Superskyyy File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# 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. | ||
name: E2E | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- "*.md" | ||
- "*.txt" | ||
- ".asf.yaml" | ||
- ".dlc.json" | ||
- ".licenserc.yaml" | ||
- "docs/*" | ||
- ".github/workflows/*" | ||
push: | ||
branches: | ||
- master | ||
schedule: | ||
- cron: '0 18 * * *' | ||
|
||
concurrency: | ||
group: ci-e2e-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Docker: | ||
name: Construct agent image | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout source codes | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Build SkyWalking Python agent base e2e image | ||
run: | | ||
docker build --build-arg BASE_PYTHON_VERSION -t apache/skywalking-python-agent:latest-e2e --no-cache . -f tests/e2e/base/Dockerfile.e2e | ||
docker save -o docker-images-skywalking-python-e2e.tar apache/skywalking-python-agent:latest-e2e | ||
env: # may support pypy in the future | ||
BASE_PYTHON_VERSION: 3.7 | ||
- name: Upload docker image | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
Superskyyy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: docker-images-skywalking-python-e2e | ||
path: docker-images-skywalking-python-e2e.tar | ||
E2E: | ||
name: Basic function + ${{ matrix.case.name }} transport (Python3.7) | ||
needs: Docker | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
case: | ||
- name: gRPC | ||
path: tests/e2e/case/grpc/e2e.yaml | ||
- name: HTTP | ||
path: tests/e2e/case/http/e2e.yaml | ||
- name: Kafka | ||
path: tests/e2e/case/kafka/e2e.yaml | ||
fail-fast: false | ||
steps: | ||
- name: Checkout source codes | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Pull SkyWalking Python agent base image | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: docker-images-skywalking-python-e2e | ||
path: docker-images | ||
- name: Load docker images | ||
run: find docker-images -name "*.tar" -exec docker load -i {} \; | ||
- name: Setup go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16' | ||
- name: Run E2E Tests | ||
uses: apache/skywalking-infra-e2e@main | ||
with: | ||
log-dir: /tmp/e2e-logs | ||
e2e-file: ${{ matrix.case.path }} | ||
- name: Upload Logs | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ failure() }} | ||
with: | ||
name: e2e_logs | ||
path: "${{ env.SW_INFRA_E2E_LOG_DIR }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ | |
'requests>=2.26.0', | ||
], | ||
'kafka': [ | ||
'kafka', | ||
'kafka-python', | ||
], | ||
}, | ||
classifiers=[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# 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. | ||
|
||
# Builds -> skywalking-agent:latest-e2e | ||
ARG BASE_PYTHON_VERSION | ||
|
||
FROM python:${BASE_PYTHON_VERSION} | ||
|
||
VOLUME /services | ||
|
||
COPY tests/e2e/base/consumer/consumer.py /services/ | ||
COPY tests/e2e/base/provider/provider.py /services/ | ||
|
||
# Copy the project and build | ||
COPY . /skywalking-python/ | ||
RUN cd /skywalking-python && make install | ||
|
||
RUN pip install requests kafka-python | ||
# Extra dependencies for e2e services | ||
RUN pip install fastapi uvicorn aiohttp | ||
|
||
# Entrypoint with agent attached | ||
Entrypoint ["sw-python", "run"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull requests require the CI check status context named
CheckStatus
to pass before they can be merged. And the check context is generated by the jobCheckStatus
in this file (line 123), if changes are in thesepaths-ignore
, the workflow won't be run and the check status context won't be reported, thus all PRs can't be merged, you need to either remove these paths-ignore, or add a dummy workflow in a separate file that run a empty job namedCheckStatus
to generate the required context, but it is hard to set the reversed condition of thesepaths-ignore
, you can see how I set in the main repo but that is still not perfect because under some cases the 2 workflows are all executedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see how it works, gonna fix it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the paths_ignore option doesn't work like what I thought.. it's crazy.
Maybe the diff method is the ultimate solution given third party action cannot be run in asf repos.
Diff method:
https://github.community/t/paths-ignore-not-working-for-base-level-files/18445/4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some third-party GHAs are approved by Apache infra and can be used, @Superskyyy take a look at this, though I haven't tried to use this GHA to achieve my goal as stated above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna try it and let you know if it works.