Comments (1)
This is an interesting question. I try to complete this task. Here I will talk about my explore journey.
About Property Based Testing
When I was in college, I encountered the technology of Property Based Testing. The teacher who teaches the C language course will leave a .o
suffix file after each assignment. When we finish the assignment, we need to execute the commands such as gcc source.c -o test.o
to generate a program to test our code. It is to randomly generate a large amount of data to test our code. According to rumors, the teacher also has a larger data test program.
But this is just a technology, we also need to apply this technology to the current project.
About Databus
The task requires the enhanced test of DataBus, so what is DataBus? This problem is very important, because we need to test according to the specific situation of the business, we need to understand the role of DataBus in the entire project architecture.
After research on the source code, I will directly conclude here.
What happens when I click the plus button in the figure below?
It will send the data format in the figure below by WebSocket to the backend-server, We can see a CMD field to mark our movement just now.
In this case, there is a place in the backend-server of the system to accept this packet. We can find it here by tracking the code.
apitable/packages/room-server/src/grpc/controllers/grpc.controller.ts
Lines 106 to 126 in 1971945
If we follow all the way, we will find that the code of the client's instruction processing is finally saved to the code of the database:
apitable/packages/room-server/src/database/ot/services/datasheet.ot.service.ts
Lines 1229 to 1291 in 1971945
In this code call stack, there is no DataBus. Where is the role of DataBus?
We open the API pop -up window above and find the column of the add record. We can see here to indicate that we requested an interface from the backend-server /fusion/v1/datasheets/
.
The code in response to this interface is here:
apitable/packages/room-server/src/fusion/fusion.api.controller.ts
Lines 261 to 285 in 1971945
If we continue from here, we can find the code to execute the command here:
apitable/packages/core/src/databus/datasheet.ts
Lines 97 to 114 in 1971945
Seeing this bold assumption, earlier, without API calls, the instructions of various operations and collaborations on the table in datasheet.ot.service.ts
, and DataBus should be upgraded to datasheet.ot.service.ts
, using the command mode. Maybe the datasheet.ot.service.ts
will be abandoned in the future, and DataBus will be replaced.
How to complete the task?
In fact, there are two main tasks.
For the first task, the doCommand
method of no specific command in the mission. However, a lot of commands are defined in the project.
apitable/packages/core/src/commands/index.ts
Lines 172 to 222 in 1971945
It seems that it is difficult for us to automatically generate commands by fast-check.js
in batches. It can only generate parameters for every command, such as the content of the table cell, etc.
In this case, we need to write a test script about fast-check.js
separately for each command.
For the second task, just test the AddFields
command.
It is also necessary to pay attention to the asynchronous and concurrency in the test process, which will cause difficulty in verifying the self -increase.
I will try to submit a PR later.
If I understand errors in some places, please help me point out and be grateful.
from apitable.
Related Issues (20)
- question: 打算什么时候从webpack迁移到vite呢? HOT 1
- Prefill function does not work on relational records
- Fix: uploading attachment through API leads to incorrect MIME type
- NextJs任意文件读取漏洞(CVE-2020-5284) HOT 3
- fix: In a vika table, when entering data in form mode, the keystroke of Tab does not work as expected.在维格表中,使用表单模式录入数据时,键入Tab不按预期工作
- local dev enviroment view history record
- fix: 搜狗输入法智能调整数字后标点功能会导致无法输入部分标点
- SMTP service cannot be used,Restarted
- fix: 不友好的文字描述 HOT 1
- feat: Add Groups for filters
- question: APITable适配国产dm数据库 HOT 1
- fix: 使用不可编辑列+可编辑列分组时甘特图拖动会导致数据错乱 HOT 1
- question: 位操作权限处理实际上带来了哪些优点? HOT 1
- fix: 渲染多行文字时对`\r\n`的处理有误
- question: Automation - Use returned data from a web request action as variables in later steps. HOT 3
- DOCKER安装启动报错
- 调用API获取表格数据问题 HOT 1
- feat: 表格操作按钮能否提示快捷键 HOT 3
- 多字段排序下部分交互导致性能问题
- 共享表格时,提示资源不存在 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apitable.