Skip to content

Commit 5de25a4

Browse files
Merge pull request #1870 from ThusharaSampath/PE
Add unit-test supported languages and adding sample links
2 parents 0d44b04 + 39d9b30 commit 5de25a4

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

en/developer-docs/docs/develop-components/integrate-unit-tests-into-the-build-pipeline.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
Choreo allows you to integrate unit tests into the build pipeline, enabling code validation before deployment. This ensures early testing of code changes, reducing the risk of defects in production.
44

5-
Currently, Choreo supports unit tests only for the `WSO2 MI` and `Ballerina` build presets.
5+
Choreo supports unit testing for the `Java`, `Python`, `Node.js`, `Go`, `.Net`, `WSO2 Micro Integrator (MI)` and `Ballerina` build presets.
66

77
## Write tests
88

9-
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](https://mi.docs.wso2.com/en/latest/develop/creating-unit-test-suite/). For step-by-step instructions on writing unit tests for Ballerina projects, see [Test Ballerina Code](https://ballerina.io/learn/test-ballerina-code/structure-tests/).
9+
You can create unit tests in your source code using standard testing libraries for your respective programming language or framework. Below are examples for WSO2 MI and Ballerina projects.
10+
11+
For step-by-step instructions on creating unit tests for WSO2 Micro Integrator projects, see [Creating a Unit Test Suite](https://mi.docs.wso2.com/en/latest/develop/creating-unit-test-suite/). For step-by-step instructions on writing unit tests for Ballerina projects, see [Test Ballerina Code](https://ballerina.io/learn/test-ballerina-code/structure-tests/).
1012

1113
Once you have written your unit tests, commit them to your source code repository.
1214

@@ -29,8 +31,28 @@ Once you have enabled unit tests, trigger a new build to run them by clicking **
2931

3032
If a unit test fails during the build, Choreo will stop the build to prevent faulty code from being deployed. To troubleshoot, click **View Details** for the failed build and expand the failed unit test step to review the test output logs.
3133

32-
## Explore a sample
33-
34-
To see unit tests in action within the build pipeline, try out the [WSO2 MI helloworld](https://github.com/wso2/choreo-samples/tree/main/hello-world-mi) sample or the [Ballerina helloworld](https://github.com/wso2/choreo-samples/tree/main/greeting-service) sample.
35-
36-
34+
## Explore samples
35+
36+
To see unit tests in action within the build pipeline, try out these samples:
37+
38+
| Build Preset | Repository Link |
39+
|--------------|-----------------|
40+
| WSO2 MI | [Helloworld MI Service](https://github.com/wso2/choreo-samples/tree/main/hello-world-mi) |
41+
| Ballerina | [Ballerina Greeting Service](https://github.com/wso2/choreo-samples/tree/main/greeting-service) |
42+
| Python | [Hello World Python Task](https://github.com/wso2/choreo-samples/tree/main/hello-world-python-task) |
43+
| NodeJS | [Hello World NodeJS Task](https://github.com/wso2/choreo-samples/tree/main/hello-world-nodejs-task) |
44+
| Java | [Hello World JAVA Task](https://github.com/wso2/choreo-samples/tree/main/hello-world-java-task) |
45+
| .Net | [Hello World .NET Task](https://github.com/wso2/choreo-samples/tree/main/hello-world-dotnet-task) |
46+
| Go | [Go Greeting Service](https://github.com/wso2/choreo-samples/tree/main/greeting-service-go) |
47+
48+
## Supported Test Frameworks
49+
50+
| Build Preset | Supported Test Frameworks |
51+
|--------------|--------------------------|
52+
| WSO2 MI | • Built-in test framework |
53+
| Ballerina | • Built-in test framework |
54+
| Python | • pytest<br>• unittest (default) |
55+
| Java | • JUnit (via Maven)<br>• JUnit (via Gradle)<br>• TestNG (via Maven/Gradle) |
56+
| Node.js | • Jest<br>• Mocha<br>• Any framework with `npm test` or `yarn test` script |
57+
| Go | • Go's built-in testing package |
58+
| .NET | • MSTest<br>• NUnit<br>• xUnit |

0 commit comments

Comments
 (0)