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

Add unit testing doc page #1692

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

ThusharaSampath
Copy link
Contributor

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.

https://github.com/wso2-enterprise/choreo/issues/31861

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email [email protected] to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

@@ -24,6 +24,8 @@ Choreo auto-generates build pipelines that may slightly differ depending on the
- Pushes the container image to a container registry. In the cloud data plane, Choreo pushes the image to a Choreo-managed registry. If it is a private data plane organization, Choreo pushes the image to a registry that you own.
- Updates service endpoints and API specifications from the provided repository if applicable.

In addition to these steps, some buildpacks support unit testing in the build pipeline. Refer to [Unit Testing in Choreo Build Pipeline](../testing/unit-testing-in-build-pipeline.md) for more details.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion:
In addition to these steps, some buildpacks support integrating unit tests into the build pipeline. For more details, see Integrate Unit Tests into the Build Pipeline.

@@ -0,0 +1,28 @@
# Unit Testing in Choreo Build Pipeline
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion:
Integrate Unit Tests into the Build Pipeline

Suggesting because the overall capability is more Choreo supporting creating and integrating unit tests into the build pipeline.

@@ -0,0 +1,28 @@
# Unit Testing in Choreo Build Pipeline

Choreo supports unit testing as part of the build pipeline, enabling users to validate their applications before deployment. This feature ensures that code changes are tested early, reducing the risk of defects in production.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion:
Choreo supports integrating unit tests into the build pipeline, allowing you to validate code before deployment. This ensures early testing of code changes, reducing the risk of defects in production.

Choreo supports unit testing as part of the build pipeline, enabling users to validate their applications before deployment. This feature ensures that code changes are tested early, reducing the risk of defects in production.

!!! note
Currently, Choreo only supports unit testing for the `WSO2 MI` buildpack.
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently, Choreo supports unit tests only for the WSO2 MI buildpack.

Copy link
Contributor

Choose a reason for hiding this comment

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

We would need to mention the component types too yeah? As of now this is supported only for Schedules Task, Manual Task, and Event Handler component types is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This supports any MI component type regardless of the type

!!! note
Currently, Choreo only supports unit testing for the `WSO2 MI` buildpack.

## How It Works
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## How It Works
## How it works

Copy link
Contributor

@Nashaath Nashaath Feb 17, 2025

Choose a reason for hiding this comment

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

We use sentence-style capitalization for all subheadings. https://github.com/wso2/docs-choreo-dev/wiki/General-Writing-Style#titles-and-headings.


In your source code, develop unit tests using standard testing libraries. For example, unit tests can be developed for a WSO2 MI project by following this [documentation](https://mi.docs.wso2.com/en/latest/develop/creating-unit-test-suite/).

### Enable Unit Testing
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Enable Unit Testing
### Enable unit testing

Copy link
Contributor

Choose a reason for hiding this comment

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

We use sentence-style capitalization for all subheadings. https://github.com/wso2/docs-choreo-dev/wiki/General-Writing-Style#titles-and-headings.

3. **Save** the changes.
4. Trigger a new build.

### View Test Results
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### View Test Results
### View test results

Copy link
Contributor

Choose a reason for hiding this comment

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

We use sentence-style capitalization for all subheadings. https://github.com/wso2/docs-choreo-dev/wiki/General-Writing-Style#titles-and-headings.


If unit testing fails, Choreo allows you to view logs. Click **View Details** of the failed build, then click the failed **Unit Test** step to view logs.

## Get Started
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we go with something along the lines of "Try it out" or "Explore a sample"?


## How It Works

### Develop tests
Copy link
Contributor

Choose a reason for hiding this comment

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

"Write" and "create" are terms commonly used in reference to unit tests. Shall we use one of those terms instead of “Develop”?


### Develop tests

In your source code, develop unit tests using standard testing libraries. For example, unit tests can be developed for a WSO2 MI project by following this [documentation](https://mi.docs.wso2.com/en/latest/develop/creating-unit-test-suite/).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion:
You can create unit tests in your source code using standard testing libraries. For step-by-step instructions on creating unit tests for WSO2 Micro Integrator projects, see [Creating a Unit Test Suite].

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