You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2022/07/11 14:09:46 UTC

[skywalking-python] branch master updated: doc: add how to test locally (#222)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git


The following commit(s) were added to refs/heads/master by this push:
     new 9099421  doc: add how to test locally (#222)
9099421 is described below

commit 909942160bd772030f45af7847f8e45564b75c9e
Author: jiang1997 <ji...@live.cn>
AuthorDate: Mon Jul 11 22:09:42 2022 +0800

    doc: add how to test locally (#222)
---
 .dockerignore                            | 19 +++++++++++++++++++
 docs/en/setup/faq/How-to-test-locally.md | 24 ++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..fb39c9b
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+venv
diff --git a/docs/en/setup/faq/How-to-test-locally.md b/docs/en/setup/faq/How-to-test-locally.md
new file mode 100644
index 0000000..55ede6d
--- /dev/null
+++ b/docs/en/setup/faq/How-to-test-locally.md
@@ -0,0 +1,24 @@
+# How to test locally?
+
+This guide assumes you just cloned the repo and are ready to make some changes.
+
+After cloning the repo, make sure you also have cloned the submodule for protocol. Otherwise, run the command below. 
+```
+git submodule update --init
+```
+
+Then run ``make setup-test``. This will create virtual environments for python and generate the protocol folder needed for the agent.
+
+By now, you can do what you want.
+
+Let's get to the topic of how to test.
+The test process requires docker and docker-compose throughout. If you haven't installed them, please install them first.
+
+In the test process, the script will create several docker containers based on a particular docker image(apache/skywalking-python-agent:latest-plugin), but the current script does not create this docker image automatically. So we need to create manually.
+```
+docker build --build-arg BASE_PYTHON_IMAGE=3.6 -t apache/skywalking-python-agent:latest-plugin --no-cache . -f tests/plugin/Dockerfile.plugin
+```
+By the way, because the test process runs in the docker container, we need to apply the changes you did to the docker image. You may need to run this command whenever you change files before the test.
+
+Then ``make test`` will run as expected.
+