-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand TestBot + Add tests #1022
Conversation
… into benbrown/testbot
write unit tests for testbot using botbuilder-testing
… into benbrown/testbot
Builds on #987 |
@ParadoxARG Can you help me update the deployment scripts, which are now out of sync with what is in samples? |
Hi Ben, The tests are probably failing because this is reverting the changes of #954 where we created a new endpoint (/api/mybot) to match the DotNet implementation. In DotNet the TestBot has an endpoint for an EchoBot and another endpoint for the Flight Assistant. The tests right now are configured to run against an EchoBot. We should replicate the same for JS and have one endpoint for the EchoBot(mybot) and another one for the CoreBot (dialogbot). Here’s the DotNet implementation. We will be running some tests over this branch, and we will let you know when we have more information about it. |
@ParadoxARG Oops, I didn't mean to regress that - I'll restore that feature and the simple echo that existed before. But do you think this is what is causing the test fail? It seems to be something about botbuilder-testing missing on npm, but it should be getting it from the monorepo through lerna. |
The test against the deployed TestBot will fail for sure without this endpoint, but as you mentioned we may be having another issue along with this. We will look into this tomorrow and run some tests against our pipeline. |
I just put that endpoint back in place :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ben, ping me tomorrow if you have any questions on the changes requested.
Also, you may want to add a FlightBooking.ts class generated using LUISGen, it may help with the mock for LUIS too.
The one I generated for C# is here: https://github.com/microsoft/BotBuilder-Samples/blob/8dcaafc51a73f6663c7f53d07f3c9eaec0b68d5d/samples/csharp_dotnetcore/13.core-bot/CognitiveModels/FlightBooking.cs
…not found warning
…n botbuilder. Renamed some test cases to use the same capitalization as bot builder. Added empty .env file. Added general .gitignore. Added TSConfig
… from master. Removed unnecesary tests for creating DialogTestClient instance. Renamed dialog variables as sut (systemt under test) to match the documentation. Fixed some tests (need to fix others)
…ted cities and work the same as the dotnet one. Added helper methods to extract LUIS values for composite entities and datetime to FlightBookingRecognizer. Added luis result json captures to testdata so we can write tests for entity extraction based on serialized results. Updated BookingDialog to use proper text, speak and inputhints. Updated DateResolverDialog to use proper text, speak and inputhints. Removed onBeginDialog from cancelAndHelpDialog to avoid handling interruptions on turn 0. Removed myBot.
Updated deployment template to point to messages instead of mybot.
updated dateResolveDialog tests to use strictEquals.
…gnizer rather than creating one on each call. Implemented 3 of for test scenarios for mainDialog (with mock dialogs and mock recognizer). deleted unused mainDialogTestCases. Updated other tests to use => instead of function(). Changed the oreder of constructor params for mainDialog.
Added placeholder for cancelAndHelpDialog.tests.
Hi @ParadoxARG, can you use the real TestBot instead of mybot for your tests? that would simplify things in the code and make it less confusing. TestBot does real work as opposed to mybot that is just an echo. |
Moved MockBookingDialogWithPrompt outside the test case for clarity.
Fixes #971
Fixes #972
Description
This PR expands TestBot to match the current CoreBot example from the Samples repo.
In addition:
Specific Changes
Testing
Check out the repo
Run lerna run test - all tests should run and test
Also go to libraries/testbot and run
npm run test
to see them run individually.