Categories:
Test a developed use case locally
Once the use case is developed, and prior to its deployment, it is required to test it in local environment. Learn how to do it in this document
Test a developed use case
There are two different options to test your brand-new use case:
- Using Aura Minibot locally, the recommended method.
- Through full bot local deployment.
Test a use case using Aura minibot
It is highly recommended to use Aura minibot for testing the use case in your local environment.
For this purpose, read the Aura minibot guidelines to know firstly how to install and run Aura minibot.
If you have already installed Aura minibot, go directly to section Develop a new use case to know how to import the use case library, after its packaging as a .tgz file.
Test a use case through full Aura Bot
Firstly, to work with full aura-bot, read the guidelines for the installation and configuration of full Aura Bot.
Now, test your use case following these instructions:
- Deploy the library to be tested. There are two options:
-
- Add the library
.tgzfile to the fileplugin-config.json(placed in theaura-bot-platformGithub repository).
Note that manual addition of libraries toplugin-config.jsonfile requires manual installation too:
npm install <library>
- Add the library
-
- Use the automatic script:
npm run import-libraries
This process will install any.tgzinaura-bot-platform/local_modulesfolder.
The previous command will add the library inpackage.jsonandplugin-config.jsonfiles and will install them into the project.
If a further configuration of the library is required (for example, disabling some dialogs), this must be done manually by editingplugin-config.jsonavailable at the root of the aura-bot-platform folder.
- Use the automatic script:
-
In the simplest case, plugin-config.json is an array of strings, each of them containing the name of the npm package of a library. It is the way used by aura-bot to configure the plugins that are going to be deployed in the runtime of each instance and is the format defined by the library used internally by aura-bot architect.
However, every element from this array can also be an object containing more information.
Note that the following two examples are totally equivalent:
[
"@telefonica/aura-bot-bill-library",
"@telefonica/aura-bot-common-library"
]
and
[
{
"packagePath": "@telefonica/aura-bot-bill-library"
},
{
"packagePath": "@telefonica/aura-bot-common-library"
}
]
When a package name is included in the plugin-config.json file, it is loaded when running the bot, and all the dialogs specified in the use case library file index.ts are loaded.
If for any reason, it is required to exclude one or more dialogs from the library, in order to not be loaded, they can be specified with the exclude property of the library, for example:
[
"@telefonica/aura-bot-bill-library",
"@telefonica/aura-bot-common-library",
{
"packagePath": "@telefonica/aura-bot-other-library",
"exclude": [
"./first-dialog"
]
}
]
In the previous example, all the dialogs from aura-bot-bill-library and aura-bot-common-library are loaded, as well as all the dialogs from aura-bot-other-library.
However, the dialog ./first-dialog is excluded (relative path, as specified within the index.ts file).
Max response times due to graceful shutdown policy (Recommendation)
Due to the infrastructure configuration, we recommend that the response time for the developed use cases should be less than the time configured in the AURA_SHUTDOWN_GRACEFUL_TTL aura-bot environment variable. If the message takes longer than the configured time, it could be lost due to aura-bot’s graceful shutdown policy, resulting in the user not receiving a response.