-[Unit tests for the new micro-service](#unit-tests-for-the-new-micro-service)
-[Integration tests for the new micro-service](#integration-tests-for-the-new-micro-service)
-[Executing a test campaign](#executing-a-test-campaign)
-[Adding Documentation for an API/Service](#adding-documentation-for-an-apiservice)
-[Dockerization](#dockerization)
-[Creating a Dockerfile](#creating-a-dockerfile)
@@ -98,7 +99,7 @@ To generate the server stubs, follow these steps:
```
Here `swagger-codegen-cli.jar` is the downloaded Swagger Codegen _jar_ file, `oas-file.yaml` is the OAS YAML file and `~/output` is the path to the folder where the server stubs will be generated to.
> **Note:** Both server stubs and client SDK are generated using Swagger Codegen. The Go client SDK is required to develop the testing tool for the MEC micro-service (see clause [creating test code](#unit-tests-for-the-new-micro-service)). The Go client SDK is required to develop the backend of a MEC application using MEC030 micro-service.
> **Note:** Both server stubs and client SDK are generated using Swagger Codegen. The Go client SDK is required to develop the testing tool for the MEC micro-service (see clause [creating test code](#unit-tests-for-the-new-micro-service)).
## Development of Emulation Logic
@@ -188,7 +189,7 @@ Steps to implement server side emulation logic:
Run the following commands to create the _go.mod_ and _go.sum_ files:
```sh
go mod init github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-<mec-identifier>
go get github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-<mec-identifier>
go mod tidy
```
After doing the above steps, the files will look something like the file/folder structure shown below:
@@ -330,6 +331,7 @@ meep-<mec-identifier>
|
\____ <mec-identifier>.go
```
## Unit tests for the new micro-service
Unit tests should be written for a MEC micro-service for its validation. The steps to achieve this are described below:
@@ -456,6 +458,25 @@ The script `start-ut-env.sh` deploys the required components to execute the test
The script `run-ut.sh` executes all the tests against the different micro-services and components.
The script `stop-ut-env.sh` deletes the components previously started by `start-ut-env.sh` script.
## Adding Documentation for an API/Service
After a new service is created, its documentation need to be added in the *AdvantEDGE/docs* folder. This documentation can be generated from the OpenAPI Specifications of the service/API:
1. Install Java on your system
2. Download the OpenAPI Generator v5.0.0-beta2 _jar_ file:
3. Run the following command to generate documentation as markdown files:
```sh
$ java -jar openapi-generator-cli.jar generate \
-i oas-file.yaml \
-g markdown \
-o ~/output
```
Here `openapi-generator-cli.jar` is the downloaded OpenAPI Generator _jar_ file, `oas-file.yaml` is the OAS YAML file and `~/output` is the path to the folder where the documentation will be generated to.
4. Copy the contents of the `output` folder over to the `AdvantEDGE/docs/api-<mec-identifier>` folder.
## Dockerization
The new feature (MEC service) will run inside a pod as a micro-service in AdvantEDGE backend. Therefore, we need to create a Dockerfile to containerize the new MEC service.