Skip to content

Commit 705e36c

Browse files
committed
Merge branch 'main' into fix/pivotBoxPlot
2 parents c4e113f + 9ca983e commit 705e36c

File tree

1,382 files changed

+9505
-4094371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,382 files changed

+9505
-4094371
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!--
2+
First of all, thank you for your contribution! 😄
3+
For requesting to pull a new feature or bugfix, please send it from a feature/bugfix branch based on the `main` branch.
4+
Before submitting your pull request, please make sure the checklist below is confirmed.
5+
Your pull requests will be merged after one of the collaborators approve.
6+
Thank you!
7+
-->
8+
9+
[[中文版模板 / Chinese template](https://github.com/VisActor/VChart/blob/main/.github/PULL_REQUEST_TEMPLATE/pr_cn.md?plain=1)]
10+
11+
### 🤔 This is a ...
12+
13+
- [ ] New feature
14+
- [ ] Bug fix
15+
- [ ] TypeScript definition update
16+
- [ ] Bundle size optimization
17+
- [ ] Performance optimization
18+
- [ ] Enhancement feature
19+
- [ ] Refactoring
20+
- [ ] Update dependency
21+
- [ ] Code style optimization
22+
- [ ] Test Case
23+
- [ ] Branch merge
24+
- [ ] Release
25+
- [ ] Site / documentation update
26+
- [ ] Demo update
27+
- [ ] Workflow
28+
- [ ] Other (about what?)
29+
30+
### 🔗 Related issue link
31+
32+
<!--
33+
1. Put the related issue or discussion links here.
34+
2. close #xxxx or fix #xxxx for instance.
35+
-->
36+
37+
### 🔗 Related PR link
38+
39+
<!-- Put the related PR links here. -->
40+
41+
### 🐞 Bugserver case id
42+
43+
<!-- paste the `fileid` field in the bugserver case url -->
44+
45+
### 💡 Background and solution
46+
47+
<!--
48+
1. Describe the problem and the scenario.
49+
2. GIF or snapshot should be provided if includes UI/interactive modification.
50+
3. How to fix the problem, and list the final API implementation and usage sample if that is a new feature.
51+
-->
52+
53+
### ☑️ Self-Check before Merge
54+
55+
⚠️ Please check all items below before requesting a reviewing. ⚠️
56+
57+
- [ ] Doc is updated/provided or not needed
58+
- [ ] Demo is updated/provided or not needed
59+
- [ ] TypeScript definition is updated/provided or not needed
60+
- [ ] Changelog is provided or not needed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!--
2+
首先,感谢您参与代码贡献! 😄
3+
为了提交新的功能或修改,请在主分支`main`分支上拉取开发分支 。
4+
在提交PR 之前,请确认下面列到的一些内容
5+
你的PR在核心成员review后,合并到主分支
6+
谢谢!
7+
-->
8+
9+
### 🤔 这个分支是...
10+
11+
- [ ] 新功能
12+
- [ ] Bug fix
13+
- [ ] Ts 类型更新
14+
- [ ] 打包优化
15+
- [ ] 性能优化
16+
- [ ] 功能增强
17+
- [ ] 重构
18+
- [ ] 依赖版本更新
19+
- [ ] 代码优化
20+
- [ ] 测试 case 更新
21+
- [ ] 分支合并
22+
- [ ] 发布
23+
- [ ] 网站/文档更新
24+
- [ ] demo 更新
25+
- [ ] Workflow
26+
- [ ] 其他 (具体是什么,请补充?)
27+
28+
### 🔗 相关 issue 链接
29+
30+
<!--
31+
1. 相关的issue或者讨论,请贴在这里.
32+
2. close #xxxx or fix #xxxx for instance.
33+
-->
34+
35+
### 🔗 相关的 PR 链接
36+
37+
<!-- 如果有关联的其他项目 PR,请贴在这里 -->
38+
39+
### 🐞 Bugserver 用例 id
40+
41+
<!-- 将 bugserver case 上的 `fileid` 字段值黏贴过来 -->
42+
43+
### 💡 问题的背景&解决方案
44+
45+
<!--
46+
1. 描述问题和场景
47+
2. 如果包含UI/交互相关的修改,请提供GIF或者截图
48+
3. 提供如何解决问题的,如果是开发新的功能,请提供最终的API实现和使用案例
49+
-->
50+
51+
### ☑️ 自测
52+
53+
⚠️ 在提交 PR 之前,请检查一下内容. ⚠️
54+
55+
- [ ] 文档提供了,或者更新,或者不需要
56+
- [ ] Demo 提供了,或者更新,或者不需要
57+
- [ ] Ts 类型定义提供了,或者更新,或者不需要
58+
- [ ] Changelog 提供了,或者不需要

.github/workflows/test.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: TEST CI
5+
6+
on:
7+
push:
8+
branches: ['main', 'develop']
9+
pull_request:
10+
branches: ['main', 'develop', 'dev/**']
11+
12+
jobs:
13+
unit-test:
14+
name: Unit Tests
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [18.x]
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Setup pnpm
26+
uses: pnpm/action-setup@v2
27+
with:
28+
version: 8
29+
30+
- name: Setup Node.js ${{ matrix.node-version }}
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
cache: 'pnpm'
35+
36+
- name: Install dependencies
37+
run: pnpm install --frozen-lockfile
38+
39+
- name: Run unit tests
40+
run: pnpm --filter @visactor/vseed test:unit
41+
42+
integration-test:
43+
name: Integration Tests
44+
runs-on: macos-13
45+
46+
strategy:
47+
matrix:
48+
node-version: [18.x]
49+
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
- name: Setup pnpm
55+
uses: pnpm/action-setup@v2
56+
with:
57+
version: 8
58+
59+
- name: Setup Node.js ${{ matrix.node-version }}
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: ${{ matrix.node-version }}
63+
cache: 'pnpm'
64+
65+
- name: Install dependencies
66+
run: pnpm install --frozen-lockfile
67+
68+
- name: Run integration tests
69+
run: pnpm --filter @visactor/vseed test:integration

.vscode/settings.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,16 @@
1717
"[json]": {
1818
"editor.defaultFormatter": "esbenp.prettier-vscode"
1919
},
20-
"cSpell.words": ["catmull", "duckdb", "Introspector", "Kysely", "permille", "preorder", "rsdoctor", "vquery", "vseed"]
20+
"cSpell.words": [
21+
"catmull",
22+
"duckdb",
23+
"Introspector",
24+
"Kysely",
25+
"permille",
26+
"preorder",
27+
"rsdoctor",
28+
"VBIDSL",
29+
"vquery",
30+
"vseed"
31+
]
2132
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
VSeed, an elegant data composer, transforming complexity into simplicity.
44

55
[![npm Version](https://img.shields.io/npm/v/@visactor/vseed.svg)](https://www.npmjs.com/package/@visactor/vseed)
6-
[![Coverage](https://img.shields.io/badge/Coverage-90.04%25-brightgreen.svg)](https://github.com/VisActor/VSeed/actions/workflows/coverage.yml)
6+
[![Coverage](https://img.shields.io/badge/Coverage-89.59%25-green.svg)](https://github.com/VisActor/VSeed/actions/workflows/coverage.yml)
77
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/VisActor/VSeed)
88
[![Changesets](https://github.com/VisActor/VSeed/actions/workflows/changesets.yml/badge.svg)](https://github.com/VisActor/VSeed/actions/workflows/changesets.yml)
99
[![Deploy to GitHub Pages](https://github.com/VisActor/VSeed/actions/workflows/deploy.yml/badge.svg)](https://visactor.github.io/VSeed/)

apps/website/docs/zh-CN/_meta.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222
{
2323
"text": "Playground",
2424
"link": "/playground/vseed",
25-
"activeMatch": "/playground",
26-
"items": [
27-
{
28-
"link": "/playground/vseed",
29-
"text": "VSeed",
30-
"activeMatch": "/playground/vseed"
31-
},
32-
{
33-
"link": "/playground/vquery",
34-
"text": "VQuery",
35-
"activeMatch": "/playground/vquery"
36-
}
37-
]
25+
"activeMatch": "/playground"
3826
},
3927
{
4028
"text": "了解VChart",

apps/website/docs/zh-CN/development/devProgress/tests.md

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,53 @@
1616
鼓励用多个小的commit, 代替一个大的commit, 否则快照变化会庞大到无法review
1717
:::
1818

19-
## 测试用例
19+
## 测试分类
2020

21-
在目录`packages/vseed/tests`内包含所有的测试用例
21+
VSeed 的测试分为两类:
22+
23+
### 单元测试(Unit Tests)
24+
25+
位于 `packages/vseed/tests/unit/` 目录下,针对独立函数、工具类、管道函数等进行单元级别的测试。
26+
27+
**特点:**
28+
- 测试粒度细,专注单一功能
29+
- 运行速度快
30+
- 无需依赖完整的 VSeed 配置
31+
- 易于定位问题
32+
33+
**运行命令:**
34+
```bash
35+
# 运行所有单元测试
36+
pnpm test:unit
37+
38+
# 运行单元测试并生成覆盖率报告
39+
pnpm test:unit:coverage
40+
```
41+
42+
### 集成测试(Integration Tests)
43+
44+
位于 `packages/vseed/tests/integration` 目录下,基于完整的 VSeed 配置进行端到端测试。
45+
46+
**特点:**
47+
- 测试完整的数据流转和图表生成
48+
- 通过快照验证最终输出
49+
- 覆盖真实使用场景
50+
51+
**运行命令:**
52+
```bash
53+
# 运行所有集成测试
54+
pnpm test:integration
55+
56+
# 运行集成测试并更新快照
57+
pnpm test:integration:update
58+
59+
# 运行集成测试并生成覆盖率报告
60+
pnpm test:integration:coverage
61+
```
62+
63+
## 集成测试用例
64+
65+
在目录`packages/vseed/tests/integration`内包含所有的集成测试用例
2266
- 每个用例是一个`json`文件, 包含一个完整的 `vseed` 配置
2367
- 每个`json`文件的文件名即为测试用例的名称
2468
- 每个 `*.test.ts` 文件均为自动生成, 请勿手动维护
@@ -28,6 +72,27 @@
2872
仅维护 `json`配置, 极大的提升测试用例的可维护性, 并降低测试用例的编写成本
2973
:::
3074

75+
## 单元测试用例
76+
77+
在目录 `packages/vseed/tests/unit/` 内包含所有的单元测试用例
78+
- 每个测试文件手动编写,针对特定函数或模块
79+
- 测试文件命名为 `*.test.ts`
80+
- 使用 Vitest 测试框架
81+
- 专注于测试独立功能,不依赖完整配置
82+
83+
**目录结构:**
84+
```
85+
tests/unit/
86+
├── pipes/ # 管道函数测试
87+
│ └── dual/
88+
│ └── dualChartType.test.ts
89+
└── utils/ # 工具函数测试
90+
├── checkVSeed.test.ts
91+
├── createFormatterByMeasure.test.ts
92+
├── findFunctions.test.ts
93+
└── measures.test.ts
94+
```
95+
3196
## build:test
3297

3398
根据每一个`vseed`, 生成测试用例, 每个用例包含`spec``advancedVseed` 的快照
@@ -51,7 +116,14 @@ pnpm run build:canvasTest
51116
运行测试并生成覆盖率报告后, 会自动生成覆盖率徽章到README.md文件, 并打开覆盖率报告页面
52117

53118
```bash
119+
# 所有测试的覆盖率
54120
pnpm test:coverage
121+
122+
# 仅单元测试的覆盖率
123+
pnpm test:unit:coverage
124+
125+
# 仅集成测试的覆盖率
126+
pnpm test:integration:coverage
55127
```
56128

57129
- **HTML 报告**: `packages/vseed/coverage/index.html`
@@ -64,4 +136,17 @@ pnpm test:coverage
64136
```bash title="source: scripts/build-coverage-badge.mjs"
65137
https://img.shields.io/badge/Coverage-{percentage}%-{color}.svg
66138
```
67-
:::
139+
:::
140+
141+
## 测试命令总览
142+
143+
| 命令 | 说明 |
144+
|------|------|
145+
| `pnpm test` | 运行所有测试(单元测试 + 集成测试) |
146+
| `pnpm test:unit` | 仅运行单元测试 |
147+
| `pnpm test:unit:coverage` | 运行单元测试并生成覆盖率报告 |
148+
| `pnpm test:integration` | 仅运行集成测试 |
149+
| `pnpm test:integration:update` | 运行集成测试并更新快照 |
150+
| `pnpm test:integration:coverage` | 运行集成测试并生成覆盖率报告 |
151+
| `pnpm test:update` | 运行所有测试并更新快照 |
152+
| `pnpm test:coverage` | 运行所有测试并生成覆盖率报告 |

0 commit comments

Comments
 (0)