Skip to content

Development documentation

Anton Roman edited this page Jun 29, 2018 · 1 revision

Development

To contribute to the development of this 5GTANGO component, you may use the very same development workflow as for any other 5GTANGO Github project. That is, you have to fork the repository and create pull requests.

Testing

Unit has been added for main classes, the CLI commands and also the REST API. Please make sure relevant unit tests are added when new functions are introduced. Valid and invalid function and service descriptors can be found in the tng-sdk-validation/src/tngsdk/validation/tests/samples/ folder and also in the examples of the tng-schema repository.

In order to execute the testing the pycode command can be directly used in the root folder of the project. It will automatically find the tests within the project and will execute them.

Using the docker image

The Dockerfile included in the project builds a fully operational tng-sdk-validate tool for testing, to execute CLI commands and also to expose its REST API in a specific port.

How to build the image

The command below builds the the Docker image which can be used later to execute the tests or any CLI command. Please note that the CLI commands indicating a file path of the local file system will not be accessible from the Docker container. A new feature will be added to be able to pass the descriptor as an attachment in the REST API request.

sudo docker build -f ./Dockerfile -t localhost:5000/tng-sdk-validation -t localhost:5000/tng-sdk-validation:latest .

How to launch the tests

In order to launch the unit tests to check that the code is passing them, the command below can be used:

sudo docker run -i --rm localhost:5000/tng-sdk-validation:latest pytest -v