DRLTT TEST

DRLTT Python Test

Python testing is done with pytest. To launch the Python testing, run ./test/test-python.sh:

#!/bin/bash

log_dir=./test-log
mkdir -p $log_dir

(
    echo "SETTING UP PYTHON TESTING ENVIRONMENT"
    source ./scripts/tests/train_eval_trace-track_test_sample_dummy.sh
    echo "TEST PYTHON CODE"
    pytest
    retval=$?
) 2>&1 | tee ./${log_dir}/python-test.log

exit $retval

DRLTT CPP Test

CPP testing is performed through gtest immediately after building. To launch the CPP testing, run ./test/test-cpp.sh:

#!/bin/bash

log_dir=./test-log
mkdir -p $log_dir

(

    echo "SETTING UP CPP TESTING ENVIRONMENT"
    if [[ $1 == "fast"  ]]; then
        gen_data_script=./scripts/tests/train_eval_trace-track_test_sample_fast.sh
        shift
    else
        gen_data_script=./scripts/tests/train_eval_trace-track_test_sample.sh
    fi

    if [[ ! ( $1 == "test" && $2 == "reuse-checkpoint" ) ]]; then
        # generate checkpoint for sdk test
        source $gen_data_script
    else
        source setup.sh
    fi
    echo "TEST CPP CODE"
    pushd sdk
        bash ./compile-in-docker.sh "$@"
        retval=$?
    popd
) 2>&1 | tee ./${log_dir}/cpp-test.log

exit $retval

Please refer to DRTLL SDK for details.

Accelerating CPP testing

To skip SDK exporting (e.g. while debugging the test running), run:

./test-cpp.sh test

To skip both SDK exporting and checkpoint generation (e.g. while debugging the test building), run:

./test-cpp.sh test reuse-checkpoint

To use a sample config with a shorter time for test data generation (a dummy training), run:

./test-cpp.sh fast test

TODO: refactor argument parsing logic in test scripts.

DRLTT Documentation Test

To test the Documentation, run ./test/test-doc.sh: