Skip to content

Conversation

@coldplaying42
Copy link
Contributor

Fixes #4227

Add unit tests for QnAMakerExtensions.

Tom Laird-McConnell and others added 30 commits April 21, 2020 18:27
Move QnAMaker Dialog/Recognizer out of Adaptive and into QnA assembly
* init multi-lang * add templates dict test * revert some renaming * make the default fallback is empty string * renaming * renaming * renaming * comments * add comments
* revert the caching behavior of json converters * ref QnaMakerDialog
* Move logic into base class * Add activityProcessed which if set to false will emit event to cause parent to process activity. * Unit tests etc.
Rename updateHandlers to deleteHandlers
- Make BotState.CachedBotState public while changing its members from public to internal - Make BotState.GetCachedState public - Add a null check for newly public method and use BotAssert in other methods for consistency - Document newly public method - Write test for newly public method
* added scoped Services property to DC. * changed ITemplate to be DialogContext based (and default to dc.State for data) * Added 3 calls to OnSetScopedServices to appropriate model scoped service for generator * changed ActionScope to use parent scoped services on resumption.
Implement Reprompt in way that maintains dialogcontext for AD.
Added tests for ActivityTemplateConverter and fixed issue loading StaticActivityTemplate
* refactored InterfaceConverter to allow better control for children to reuse * custom serilization for staticActivityTemplate and ActivityTemplate * fixed schema around activity definition
tweaks to schema per feedback from composer team
@coldplaying42 coldplaying42 requested review from chrimc62 and tomlm July 8, 2020 09:02
Copy link

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

Copy link

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@coldplaying42 coldplaying42 marked this pull request as ready for review July 14, 2020 06:48
@coldplaying42 coldplaying42 requested review from a team, gabog and mrivera-ms as code owners July 14, 2020 06:48
Copy link
Contributor

@gabog gabog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR seems to include changes that are not properly described in the root issue (or the PR comments).
Consider making the QnAMakerExtensions a separate PR or update the issue description to reflect what's being done.
The change that this PR is trying to address (default answer) does not seem to have a unit test associated with it.

var environment = configuration.GetValue<string>("environment") ?? Environment.UserName;
var settings = new Dictionary<string, string>();
settings["luis:endpoint"] = $"https://{luisRegion}.api.cognitive.microsoft.com";
settings["luis:endpoint"] = configuration.GetValue<string>("luis:endpoint") ?? $"https://{luisRegion}.api.cognitive.microsoft.com";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this related to the issue associated with this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have discarded this change.

/// <summary>
/// Extension methods for QnA.
/// </summary>
public static class QnAMakerExtensions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this related to the issue associated with this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have splitted this PR into two new PRs.

/// <param name="qnaRegion">qnaRegion.</param>
/// <param name="environment">enviroment.</param>
/// <returns>Modified configuration builder.</returns>
public static IConfigurationBuilder UseQnAMakerSettings(this IConfigurationBuilder builder, string botRoot, string qnaRegion, string environment)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a lot of context on this approach, but if this is trying to be similar to LuisExtensions, why doesn't it have the same arguments? shouldn't the look and work the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not want to revise the existing luis extension. But we hope to set the default values for qna maker extension in testbot.json.


var instance = new JArray();
instance.Add(JObject.FromObject(topAnswer));
var data = JObject.FromObject(topAnswer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need unit tests for this code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the unit tests.

@cleemullins cleemullins added blocked Current progress is blocked on something else. needs rebase labels Jul 15, 2020
@coldplaying42 coldplaying42 deleted the zoma/testbot2 branch September 28, 2020 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Current progress is blocked on something else.