Skip to content

Commit c917741

Browse files
Merge pull request #1867 from ThusharaSampath/PE
Update unit test doc with ballerina support
2 parents d6c5b6a + d353f69 commit c917741

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

en/developer-docs/docs/develop-components/deploy-an-application-with-buildpacks.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,6 @@ Follow the guidelines below based on your language:
166166

167167
You can configure the environment variables necessary to build the component using the **Build Configurations Editor** on the component **Build** page.
168168

169-
!!! info
170-
The capability to configure build-time environment variables is not available for components created using **Ballerina** or **WSO2 MI** build presets.
171-
172169
During the build process, the build-time environment variables and their values are passed to the build preset. Therefore, you can configure both build preset-specific environment variables and those required for the component build.
173170

174171
For example, if you want to override the Maven command of the **Java** build presets, you can use `GOOGLE_MAVEN_BUILD_ARGS` as the environment key and `clean install` as the value.

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,35 @@
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-
!!! note
6-
Currently, Choreo supports unit tests only for the `WSO2 MI` build preset.
5+
Currently, Choreo supports unit tests only for the `WSO2 MI` and `Ballerina` build presets.
76

8-
## How it works
7+
## Write tests
98

10-
### Step 1: Write tests
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/).
1110

12-
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/).
11+
Once you have written your unit tests, commit them to your source code repository.
1312

14-
### Step 2: Enable unit tests
13+
## Enable unit tests
14+
15+
To enable unit tests in the build pipeline for a component with unit tests in its source code, follow these steps:
1516

1617
1. Sign in to the [Choreo Console](https://console.choreo.dev/).
17-
2. In the **Component Listing** pane, click the component for which you want to enable unit tests.
18+
2. In the **Component Listing** pane, click the component for which you want to enable unit tests.
1819
3. In the left navigation menu, click **Build**.
1920
4. On the **Build** page, click to edit **Build Configurations**.
2021
5. Turn on the **Unit Test** toggle.
2122
6. Click **Save**.
2223

23-
### Step 3: Trigger a new build
24-
25-
- On the **Build** page, click **Build Latest**.
24+
## Trigger a new build
2625

27-
This starts a new build with unit tests enabled. You can monitor its progress in the **Build Details** pane.
26+
Once you have enabled unit tests, trigger a new build to run them by clicking **Build Latest**. This starts a new build with unit tests enabled. You can monitor its progress in the **Build Details** pane.
2827

2928
## View failed unit tests
3029

31-
If a unit test fails during the build, you can view its detailed logs for troubleshooting. Click **View Details** corresponding to the failed build, then expand the failed unit test step to view the logs.
30+
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.
3231

3332
## Explore a sample
3433

35-
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.
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+

0 commit comments

Comments
 (0)