You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/07/11 11:54:17 UTC

[GitHub] [skywalking-python] kezhenxu94 commented on a diff in pull request #222: doc: add How to test locally

kezhenxu94 commented on code in PR #222:
URL: https://github.com/apache/skywalking-python/pull/222#discussion_r917844643


##########
docs/en/setup/faq/How-to-test-locally.md:
##########
@@ -0,0 +1,36 @@
+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.
+Here is the practice I employed.
+
+Create a file in the folder you just cloned.
+```
+FROM python:3.8
+
+WORKDIR /usr/src/app
+
+COPY . .
+
+RUN pip install -r requirements.txt
+RUN pip install -e .[test]
+then
+```
+
+Then run the command below to create the docker image we need later. 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 any files before the test.
+```
+docker build -t apache/skywalking-python-agent:latest-plugin .  -f Dockerfile.test 
+```

Review Comment:
   All these can be simplified as 
   
   ```
   docker build --build-arg BASE_PYTHON_IMAGE=3.6 -t apache/skywalking-python-agent:latest-plugin --no-cache . -f tests/plugin/Dockerfile.plugin
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org