-
Notifications
You must be signed in to change notification settings - Fork 334
Provide CN translation for unit-testing.rst (resubmit) #1674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Hi @zztiger123 @April-Yjj PTAL, thx! PS Content in this PR has already been technically reviewed in the old PR. |
Download the artifacts for this pull request: |
.. note:: | ||
|
||
3. Copy the unity-app from the extension template and add the test components to the main CMakeLists.txt ``TEST_COMPONENTS`` cmake variable. The extension unity-app is a basic ESP-IDF application with a unity menu that will be built and flashed on the current **idf.port** serial device with all test cases that were found during exploration step. | ||
Unit tests in this extension requires `ESP-IDF pytest requirements <https://github.com/espressif/esp-idf/blob/master/tools/requirements/requirements.pytest.txt>`_ to be installed in your Python virtual environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @brianignacio5 This link leads to a 404 page, pls help fix, thx~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ESP-IDF changed the way pytest is installed and defined. This would require a bigger change on the vscode extension.
@April-Yjj The warnings have already been resolved. However, this PR skipped all CI checks, and I’m not sure why. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Shen7436 Thansk for your translation! Left a few comments. Overall LGTM.
|
||
.. note:: | ||
您也可以使用 **ESP-IDF 单元测试:安装 ESP-IDF PyTest 要求** 扩展命令创建、构建和烧录 unity 测试应用程序,该命令将复制构建并烧录生成的单元测试应用程序到您的设备。 | ||
2. 如果在 ``settings.json`` 文件中 ``idf.toolsPath`` 配置项所指定的 Python 虚拟环境中未找到 ESP-IDF 所需的 pytest 依赖,则系统会自动安装这些依赖。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
前面说“运行命令安装依赖”,这句是不是想说,如果未找到依赖则需要手动安装?现在翻译的是如果未找到依赖会自动安装,有点不符合常理。原文里暂时没找到自动安装的意思,可能需要确认一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“When you press the run
button on a test, it will configure the current project before the tests as follows:” 这里的 it 就是指系统吧。相当于 "run" 这个 button 就是一个触发,可以检查所有必要的安装项目,如果发现没安装,就会自动装上。和下面第三条内容的note是呼应的。所有没有通过命令手动安装的配置都会触发”run“之后被安装。
2. 如果在 ``settings.json`` 文件中 ``idf.toolsPath`` 配置项所指定的 Python 虚拟环境中未找到 ESP-IDF 所需的 pytest 依赖,则系统会自动安装这些依赖。 | ||
|
||
4. 运行 `pytest-embedded <https://docs.espressif.com/projects/pytest-embedded/en/latest/index.html>`_,这是一个扩展 PyTest 以在 esp-idf 设备上运行的插件,并在 unity-app 目录中以 XML 文件形式输出结果。这作为扩展任务执行,输出显示在终端中(类似于构建和烧录任务)。pytest 命令使用 **idf.pyTestEmbeddedServices** 配置设置中指定的嵌入式服务(默认:``["esp", "idf"]``)。 | ||
3. 从扩展模板中复制 ``unity-app``,并将所需的测试组件添加到主 ``CMakeLists.txt`` 文件的 ``TEST_COMPONENTS`` CMake 变量中。扩展提供的 ``unity-app`` 是一个包含单元测试菜单的简单 ESP-IDF 应用程序,且会被构建并烧录到 ``idf.port`` 指定的串口设备上,同时运行所有发现的测试用例。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 单元测试 -> Unity 测试。这里是 Unity 不是 unit. Please check globally.
- 看原文和下文 note 的意思,测试用例在这里仅仅是被构建和烧录,而不是运行。Please confirm.
3. 从扩展模板中复制 ``unity-app``,并将所需的测试组件添加到主 ``CMakeLists.txt`` 文件的 ``TEST_COMPONENTS`` CMake 变量中。扩展提供的 ``unity-app`` 是一个包含单元测试菜单的简单 ESP-IDF 应用程序,且会被构建并烧录到 ``idf.port`` 指定的串口设备上,同时运行所有发现的测试用例。 | |
3. 从扩展模板中复制 ``unity-app``,并将所需的测试组件添加到主 ``CMakeLists.txt`` 文件的 ``TEST_COMPONENTS`` CMake 变量中。扩展提供的 ``unity-app`` 是一个包含 Unity 测试菜单的简单 ESP-IDF 应用程序,该程序会和探索步骤中发现的测试用例一起,构建并烧录到 ``idf.port`` 指定的串口设备上。 |
This PR:
Adjusts some format issues and unclear expressions for unit-testing.rst based on Espressif Style Guide
Provides CN translation for unit-testing.rst
TODO: Closes DOC-12102 once merged