You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2019/12/23 05:21:21 UTC

[incubator-echarts.wiki] branch master updated: Updated How to make a pull request (markdown)

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

ovilia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.wiki.git


The following commit(s) were added to refs/heads/master by this push:
     new 54a12d9  Updated How to make a pull request (markdown)
54a12d9 is described below

commit 54a12d95f34597457999a40ed5b58e215b6f2bed
Author: Ovilia <zw...@gmail.com>
AuthorDate: Mon Dec 23 13:21:16 2019 +0800

    Updated How to make a pull request (markdown)
---
 How-to-make-a-pull-request.md | 77 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 74 insertions(+), 3 deletions(-)

diff --git a/How-to-make-a-pull-request.md b/How-to-make-a-pull-request.md
index a07a7e3..d678f00 100644
--- a/How-to-make-a-pull-request.md
+++ b/How-to-make-a-pull-request.md
@@ -9,7 +9,7 @@ If you wish to make a pull request to the ECharts project, please read the follo
 3. Leave a comment on the issue and tell us that you are going to look into the issue
 4. (Optional) If you wish to discuss the issue, read [Discussion](#discussion)
 5. Before you start writing code, read [Coding Standard](#coding-standard)
-6. Read How to Debug ECharts
+6. Read [How to setup the dev environment](https://github.com/apache/incubator-echarts/wiki/How-to-setup-the-dev-environment)
 
 ### Making a Pull Request
 
@@ -56,11 +56,82 @@ git checkout -b fix-xxx
 If you are a committer of the `apache/incubator-echarts` project, which means you have the write access to the project, you still need to push to a new branch (by `git push origin HEAD:refs/heads/fix-xxxx`) and use pull request to push your code. You cannot push code directly to `master` branch, otherwise it will be rejected by GitHub.
 
 
-## How to Debug ECharts
+## Setup the dev environment
 
-Checkout Wiki: [How to debug?](https://github.com/apache/incubator-echarts/wiki/How-to-debug%3F)
+Checkout Wiki: [How to setup the dev environment](https://github.com/apache/incubator-echarts/wiki/How-to-setup-the-dev-environment).
 
 
+## Test
+
+In most cases, one or more test cases should be added when developing a feature or fixing a bug.
+All of the existing test cases are in directory `~/workspace/echarts/test`.
+Check the file `~/workspace/echarts/test/dataZoom-action.html` as an example.
+
+### Organize test cases
+
+Each file can be regard as a **test suite** and each chart in the file can be regard as a **test case**,
+which contains one or multiple expected results (check points).
+If a feature or bug is related to a chart type or a component type, probably it should belongs to
+a test file named `chartOrComponentType-someSubCategory.html`. Or some common feature is related
+to multiple chart or component or has nothing to do with chart and component, probably it should
+belongs a test file named `featureName-someSubCateogory.html`.
+
+### Naming of test files
+
+Generally speaking, the name of the test file should start with a chart type or component type
+or a common feature name (like "hoverStyle", "clip").
+
+### Add a test case
+
+If intending to add a test case, firstly try to find in the existing test files which file this
+new test case might belongs to.
+
+If an existing file found, add the test case to the file.
+
+Otherwise, add a new test file by commands as follows:
+
+```shell
+# Make a file named "bar-action.html" in directory "echarts/test" with 1 initial chart.
+npm run mktest bar-action
+# or `npm run mktest bar-action.html`
+
+# Make a file named "bar-action.html" in directory "echarts/test" with 5 initial charts.
+npm run mktest bar-action 5
+```
+
+### The expected results and the instructions of user interaction
+
+Although we have auto-visual-test tool to run tests, we should better write the expected result
+(check points) for each test cases for manual checking.
+
+Some cases need user interactions involved. The instructions should be written clearly.
+
+The expected results and the user instructions should be written in the `title` filed when creating a test by `testHelper.create` as follows:
+
+```js
+var chart = testHelper.create(echarts, 'main0', {
+    title: [
+        'Hover on the red circle',
+        '**A blue label** should appear on the **top of red circle**.'
+    ],
+    option: option
+});
+```
+
+## Run test cases
+
+Before making a pull request, you must run `npm run test` locally to do the unit tests.
+
+Visual tests are optional. If you changed view related logic, please test the related visual cases. For example, if you add a new layout for pie chart labels, you should run the visual tests of all pie test cases and add new cases if needed.
+
+```bash
+# puppeteer is not in the devDependencies and needs to be installed manually
+npm install puppeteer --no-save
+npm run test:visual
+```
+
+It will run all the test cases under `~/workspace/echarts/test` automatically to compare with the previous version. You can use this to check if your code bring some breaking change.
+
 ## Git Message Standard
 
 Git commit messages are in the following format:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org