Unit Testing for the CI/CD
This feature allows you to unit test your Flogo app using the app executable. Once you have built the executable for a Flogo app, you can run a unit test using the test
command. This feature is also useful to automate the testing process for activities in development in CI/CD pipeline.
You can even generate the files using the platform API by following the below steps:
- Procedure
-
Export the app JSON. For details, see exporting an app with the API.
-
Build an app executable. For details, see building an app executable.
-
Download the built app executable. For details, see downloading the app executable.
-
Export the test suite file. For details, see exporting a test suite file with API.
After you have downloaded the app executable file and the test suite file, you can build a CI/CD pipeline to run the unit test using the below mentioned commands.
Follow these steps to get help on the test command:
- Procedure
- Open a command prompt or terminal window depending on your platform.
- Navigate to the folder where you stored the app executable.
-
Run the following command to get the online help on the test command:
- On Windows:
<app-executable> --test --test-file
- On Macintosh:
./<app-executable> -test --test-file
- On Linux:
./<app-executable> -test --test-file
This command outputs the usage for the
test
command along with some examples. see the test commands for details. - On Windows:
-
Run the command with the appropriate option to test your app.
The output of the command generates the .testresult
file for the unit test suites or test cases that are run.