deep-learning-toolkit

Test Guide

This guide is intended for DLTK developers and anyone who wants to create and run DLTK tests.

Running Tests

The main script for running tests is test/test.py, located in the root of the repository. The following sections describe possible ways for executing the test script.

From Shell

The most straightforward approach is running the test/test.bash shell script.

The following illustrates the how to run the tests:

cd $DLTK_REPO/test
./test.bash

Requirements:

From Visual Studio Code

This repository contains Visual Stop Code configuration, including a Task definition (see .vscode/tasks.json) for running the tests.

Use the keyboard shortcut Ctrl+Shift+P to open the command palette and enter Tasks: Run Test Task.

Optionally, environment variables (like DLTK_ENVIRONMENT and SPLUNK_PASSWORD) can be defined in the file run.env, located in the test/ folder. For example:

DLTK_ENVIRONMENT="my-kubernetes-cluster"
SPLUNK_PASSWORD="changeme"`

Note: Since the task wraps the test/test.bash shell script, the same requirements apply here.

From Building DLTK

One of the steps that are part of the DLTK build process is running the tests.

If you are looking for documentation on how to build DLTK, please see the Build Guide.

Creating Tests

If you want to create and add tests for DLTK, create the test_*.py file in the module that contains the code that you want to test.

Tests are build using the https://docs.python.org/3/library/unittest.html Python testing framework.

TODO: Explain the different type of tests and provide a examples