Commit e6f03fe6 authored by Yann Garcia's avatar Yann Garcia
Browse files

Add System tests clause

parent f156282d
Loading
Loading
Loading
Loading
+35 −1
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
    - [Client-side](#client-side)
      - [Code organization](#code-organization)
  - [Unit tests for the new micro-service](#unit-tests-for-the-new-micro-service)
  - [System tests for the new micro-service](#system-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)
@@ -334,7 +335,8 @@ meep-<mec-identifier>

## 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:
Unit tests should be written for a MEC micro-service for its validation. The purpose of the Unit tests is to provide one or more testing function for each of the exposed API functions.
The steps to achieve this are described below:

1. **Create a testing file**

@@ -466,6 +468,38 @@ cd test
./stop-ut-env.sh
```

## System tests for the new micro-service

System tests should be written for a MEC micro-service for its validation. The purpose of System tests is to test the micro service logic (functional tests).
The steps to achieve this are described below:

1. **Create a testing files**

   In the folder ~/AdvantEDGE/test/system, create two files;
   - The source code file, named `<mec-identifier>_test.go` (e.g. vis_test.go),
   - The network scenario file, named `<mec-identifier>-system-test.yaml` (e.g. vis-system-test.yaml).

The network scenario is used by the MEC micro-service testing functions.

2. **Implement System tests**

   At least, the following functions shall be implemented into `<mec-identifier>_test.go` file:
   - The initialization functions: `func init()` and `func initialiseRnisTest()`
   - The cleanup function: `func clearUpRnisTest()`
   - load scenario testing function: `func Test_RNIS_load_scenarios(t *testing.T)`

3. **Executing the tests for a single MEC service**

   Execute the following command:
   ```sh
   # Launch the AdvantEDGE platform...
   meepctl deploy dep && sleep 5 && meepctl deploy core && sleep 5
   # Launch the test campaign...
   $ ~/AdvantEDGE/test/system/loopTest 2
   # When tests are achieved, stop the AdvantEDGE platform
   meepctl delete core && sleep 5 && meepctl delete dep && sleep 5
   ```

## 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: