Skip to content
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

feat: added contents for testing of wasmedge #197

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

adithyaakrishna
Copy link
Contributor

Description:

This PR adds the written content for testing of WasmEdge software with the explanation of an example code for test/plugins/wasi_logging

PS. This is a draft that needs to be improved and coming from a person who got started with C++ testing

Copy link
Collaborator

alabulei1 commented Nov 15, 2023

Hello, I am a code review bot on flows.network. Here are my reviews of code commits in this PR.


Overall Summary:

The pull request titled "feat: added contents for testing of wasmedge" includes several key changes related to the documentation for testing in the WasmEdge project. After reviewing the individual summaries, it is apparent that there are no potential problems or errors identified in this pull request.

The most important findings include the following:

  • The testing content should be thoroughly reviewed and tested to ensure its accuracy and completeness.
  • The code examples provided in the documentation should be reviewed for correctness and accuracy.
  • The documentation could benefit from more details, such as code explanations, comments, and examples, to make it more helpful for readers.
  • It is important to review and verify the correctness of the module creation and memory manipulation functions mentioned in the documentation.

Overall, this pull request aims to improve the testing documentation in the WasmEdge project. It is recommended to carefully review and test the added contents, provide more detailed explanations and examples, and ensure the correctness of the code examples and functions mentioned in the documentation.

Details

Commit 298e985a4284c0c4e83c15f72f153140e65abd73

Key Changes:

  • Added a new file docs/contribute/test/_category_.json which provides information about building WasmEdge from source.
  • Added a new file docs/contribute/test/testing.md which contains documentation about writing tests for C++ code targeting WebAssembly.
  • Deleted the file docs/contribute/test.md.

Potential Problems:

  • It is unclear if the testing content has been thoroughly reviewed and tested.
  • The code examples provided in docs/contribute/test/testing.md should be reviewed for correctness and accuracy.
  • The documentation could benefit from more details, such as code explanations, comments, and examples, to make it more helpful for readers.
  • It is unclear if the module creation and memory manipulation functions mentioned in the documentation are implemented correctly.

Suggestions:

  • Review and test the testing content to ensure its accuracy and completeness.
  • Provide detailed explanations, comments, and examples in the documentation to make it more informative and useful.
  • Review and verify the correctness of the code examples provided in the documentation.
  • Ensure that the module creation and memory manipulation functions mentioned in the documentation are implemented correctly and reviewed for potential issues.

Commit 57185441c321037457908c246f5910d88b244fd1

Key changes in the patch:

  1. Added links and i18n content for testing WasmEdge.
  2. Created a new file docs/contribute/test/example.md with test example explanation.
  3. Updated _category_.json files in both English and Chinese language folders to reflect the new content.
  4. Deleted the file i18n/zh/docusaurus-plugin-content-docs/current/contribute/test.md, which was probably replaced with example.md.
  5. Added new files i18n/zh/docusaurus-plugin-content-docs/current/contribute/test/_category_.json, i18n/zh/docusaurus-plugin-content-docs/current/contribute/test/example.md, and i18n/zh/docusaurus-plugin-content-docs/current/contribute/test/testing.md.

Potential problems:

  • No potential problems found.

Commit f9203f0be57014e1da21772603c04f70a2e52649

Key Changes:

  • Updated the description of the testing guide in docs/contribute/test/_category_.json and i18n/zh/docusaurus-plugin-content-docs/current/contribute/test/_category_.json.
  • Updated the module description in docs/contribute/test/testing.md and i18n/zh/docusaurus-plugin-content-docs/current/contribute/test/testing.md.
  • Added a section on where to add the tests in docs/contribute/test/testing.md and i18n/zh/docusaurus-plugin-content-docs/current/contribute/test/testing.md.

Potential Problems:

  • There are no potential problems identified in this pull request.

Overall, this pull request updates the documentation related to testing in the WasmEdge project. The changes provide clearer descriptions and instructions for writing tests and where to add them.

Commit e38054737035af4c7b5ac32a0ab6af661d17b7ad

Key changes:

  • The broken link for "Test WasmEdge" in both English and Chinese versions of the overview.md file has been fixed to point to ./test/testing.md instead of test.md.

Potential problems:

  • There doesn't seem to be any potential problems in this patch. It's a simple fix to correct the broken links, which will improve the user experience.

Overall, this patch is straightforward and solves the issue of broken links in the overview.md file. It can be merged without any concerns.

Commit 4e017860741f9f537bd7cdd8bd6cd844648eedab

Key Changes:

  • Updated the module title from "C++ Code" to "Wasm Code".
  • Changed the introductory paragraph to reflect that the module teaches about writing tests for Wasm code.
  • Updated the example code snippet to use Wasm code and plugins.
  • Updated the title and content in the "WasmEdge Module Tests" section.
  • Removed the outdated links in the "Further Reading" section.
  • Added a note about adding documentation in plugin test folders.

Potential Problems:

  • None

Overall, the changes made in this pull request update the documentation to reflect the correct terminology and make it more accurate for the purpose of writing tests for WebAssembly code and plugins. The changes seem appropriate and do not introduce any potential problems.

@adithyaakrishna
Copy link
Contributor Author

CI is failing which is expected as I removed the old test.md file. I will fix the broken links once the contents are reviewed and finalized

docs/contribute/test/_category_.json Outdated Show resolved Hide resolved
docs/contribute/test/testing.md Outdated Show resolved Hide resolved
Signed-off-by: Adithya Krishna <[email protected]>
Signed-off-by: Adithya Krishna <[email protected]>
@adithyaakrishna adithyaakrishna marked this pull request as ready for review November 20, 2023 10:52
docs/contribute/test/testing.md Outdated Show resolved Hide resolved
docs/contribute/test/testing.md Outdated Show resolved Hide resolved
docs/contribute/test/testing.md Outdated Show resolved Hide resolved
docs/contribute/test/testing.md Show resolved Hide resolved
docs/contribute/test/testing.md Outdated Show resolved Hide resolved
docs/contribute/test/testing.md Outdated Show resolved Hide resolved
docs/contribute/test/testing.md Outdated Show resolved Hide resolved
docs/contribute/test/testing.md Outdated Show resolved Hide resolved
docs/contribute/test/testing.md Outdated Show resolved Hide resolved
@alabulei1
Copy link
Collaborator

Can you also mention that we use codedev to auto test the test cases for the WasmEdge. https://app.codecov.io/gh/WasmEdge/WasmEdge

@adithyaakrishna
Copy link
Contributor Author

@alabulei1 Okay sure, will mention that too

@alabulei1
Copy link
Collaborator

alabulei1 commented Nov 21, 2023

@alabulei1 Okay sure, will mention that too

You didn't make any changes. Right? @adithyaakrishna Please check out my comments. We don't need other iirrelevant content in this guide.

@adithyaakrishna
Copy link
Contributor Author

@alabulei1 I hadn't done pushed the changes I did, but have updated it with the above commit. Could you please review it again?


# Example Test Explaination

The provided code snippet is a C++ test suite for a WebAssembly module, specifically focusing on a logging functionality within the WasmEdge runtime environment. It uses Google Test (gtest) for structuring and executing the tests. Let's break down the code into its key components for a clearer understanding:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the code source?


> Note: You can add the documentation in the plugin test folders you create

### Blogs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I don't think we need this.

### Code Explanation and Comments

The provided code snippet demonstrates how to set up and execute tests for a WebAssembly code or the plugins you create, specifically using the WasmEdge runtime. The code is structured into two main parts: the test setup and the test cases themselves.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From here, what's the difference between example.md and testing.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants