Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
<DefineConstants>SIGNASSEMBLY</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TF_BUILD)' != '' ">
<DefineConstants>$(DefineConstants);AUTOMATEDBUILD</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<!-- Rules found at: https://aka.ms/Microsoft-NuGet-Compliance -->
<PackageProjectUrl>https://github.com/Microsoft/botbuilder-dotnet</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ namespace Microsoft.Bot.Builder.FunctionalTests
{
[TestClass]
[TestCategory("FunctionalTests")]
#if !AUTOMATEDBUILD
[Ignore]
#endif
public class DirectLineClientTests
{
private static string directLineSecret = null;
Expand Down Expand Up @@ -114,13 +117,13 @@ private void GetEnvironmentVars()
directLineSecret = Environment.GetEnvironmentVariable("DIRECTLINE");
if (string.IsNullOrWhiteSpace(directLineSecret))
{
Assert.Inconclusive("Environment variable 'DIRECTLINE' not found.");
Assert.Fail("Environment variable 'DIRECTLINE' not found.");
}

botId = Environment.GetEnvironmentVariable("BOTID");
if (string.IsNullOrWhiteSpace(botId))
{
Assert.Inconclusive("Environment variable 'BOTID' not found.");
Assert.Fail("Environment variable 'BOTID' not found.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
namespace Microsoft.Bot.Builder.FunctionalTests
{
[TestClass]

[TestCategory("FunctionalTests")]
[Ignore("DirectLine Speech tests require updates to the REST API and CLI to be able to properly provision a bot.")]
public class DirectLineSpeechTests
Expand Down Expand Up @@ -91,14 +90,14 @@ private void GetEnvironmentVars()
speechBotSecret = Environment.GetEnvironmentVariable("SPEECHBOTSECRET");
if (string.IsNullOrWhiteSpace(speechBotSecret))
{
Assert.Inconclusive("Environment variable 'SPEECHBOTSECRET' not found.");
Assert.Fail("Environment variable 'SPEECHBOTSECRET' not found.");
}

// The cog services key for use with DLS.
speechSubscription = Environment.GetEnvironmentVariable("SPEECHSUBSCRIPTION");
if (string.IsNullOrWhiteSpace(speechSubscription))
{
Assert.Inconclusive("Environment variable 'SPEECHSUBSCRIPTION' not found.");
Assert.Fail("Environment variable 'SPEECHSUBSCRIPTION' not found.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ namespace Microsoft.Bot.Builder.FunctionalTests
[TestClass]
[TestCategory("FunctionalTests")]
[TestCategory("Adapters")]
#if !AUTOMATEDBUILD
[Ignore]
#endif
public class FacebookChatTests
{
private const string FacebookUrlBase = "https://graph.facebook.com/v5.0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ namespace Microsoft.Bot.Builder.FunctionalTests
[TestClass]
[TestCategory("FunctionalTests")]
[TestCategory("Adapters")]
#if !AUTOMATEDBUILD
[Ignore]
#endif
public class SlackClientTest
{
private const string SlackUrlBase = "https://slack.com/api";
Expand Down Expand Up @@ -136,31 +139,31 @@ private void GetEnvironmentVars()
_slackChannel = Environment.GetEnvironmentVariable("SlackChannel");
if (string.IsNullOrWhiteSpace(_slackChannel))
{
Assert.Inconclusive("Environment variable 'SlackChannel' not found.");
Assert.Fail("Environment variable 'SlackChannel' not found.");
}

_slackBotToken = Environment.GetEnvironmentVariable("SlackBotToken");
if (string.IsNullOrWhiteSpace(_slackBotToken))
{
Assert.Inconclusive("Environment variable 'SlackBotToken' not found.");
Assert.Fail("Environment variable 'SlackBotToken' not found.");
}

_slackClientSigningSecret = Environment.GetEnvironmentVariable("SlackClientSigningSecret");
if (string.IsNullOrWhiteSpace(_slackClientSigningSecret))
{
Assert.Inconclusive("Environment variable 'SlackClientSigningSecret' not found.");
Assert.Fail("Environment variable 'SlackClientSigningSecret' not found.");
}

_slackVerificationToken = Environment.GetEnvironmentVariable("SlackVerificationToken");
if (string.IsNullOrWhiteSpace(_slackVerificationToken))
{
Assert.Inconclusive("Environment variable 'SlackVerificationToken' not found.");
Assert.Fail("Environment variable 'SlackVerificationToken' not found.");
}

_botName = Environment.GetEnvironmentVariable("BotName");
if (string.IsNullOrWhiteSpace(_botName))
{
Assert.Inconclusive("Environment variable 'BotName' not found.");
Assert.Fail("Environment variable 'BotName' not found.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace Microsoft.Bot.Builder.FunctionalTests
[TestClass]
[TestCategory("FunctionalTests")]
[TestCategory("Adapters")]
#if !AUTOMATEDBUILD
[Ignore]
#endif
public class TwilioNumberTests
{
private string _botEndpoint;
Expand Down Expand Up @@ -101,31 +104,31 @@ private void GetEnvironmentVars()
_twilioNumber = Environment.GetEnvironmentVariable("TWILIO_NUMBER");
if (string.IsNullOrWhiteSpace(_twilioNumber))
{
Assert.Inconclusive("Environment variable 'TwilioNumber' not found.");
Assert.Fail("Environment variable 'TwilioNumber' not found.");
}

_twilioAuthToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");
if (string.IsNullOrWhiteSpace(_twilioAuthToken))
{
Assert.Inconclusive("Environment variable 'TWILIO_AUTH_TOKEN' not found.");
Assert.Fail("Environment variable 'TWILIO_AUTH_TOKEN' not found.");
}

_twilioAccountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
if (string.IsNullOrWhiteSpace(_twilioAccountSid))
{
Assert.Inconclusive("Environment variable 'TWILIO_ACCOUNT_SID' not found.");
Assert.Fail("Environment variable 'TWILIO_ACCOUNT_SID' not found.");
}

_senderNumber = Environment.GetEnvironmentVariable("SENDER_NUMBER");
if (string.IsNullOrWhiteSpace(_senderNumber))
{
Assert.Inconclusive("Environment variable 'SENDER_NUMBER' not found.");
Assert.Fail("Environment variable 'SENDER_NUMBER' not found.");
}

_botEndpoint = Environment.GetEnvironmentVariable("TwilioValidationUrl");
if (string.IsNullOrWhiteSpace(_botEndpoint))
{
Assert.Inconclusive("Environment variable 'TwilioValidationUrl' not found.");
Assert.Fail("Environment variable 'TwilioValidationUrl' not found.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace Microsoft.Bot.Builder.FunctionalTests
[TestClass]
[TestCategory("FunctionalTests")]
[TestCategory("Adapters")]
#if !AUTOMATEDBUILD
[Ignore]
#endif
public class WebexClientTest
{
private const string WebexUrlBase = "https://api.ciscospark.com/v1";
Expand Down
22 changes: 8 additions & 14 deletions build/yaml/botbuilder-dotnet-ci-slack-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ variables:
BuildPlatform: 'any cpu'
MSBuildArguments: -p:SignAssembly=false -p:delaySign=false -p:RunAnalyzersDuringBuild=false
Parameters.solution: Microsoft.Bot.Builder.sln
ReleasePackageVersion: 4.8.0-preview-$(Build.BuildNumber)
ReleasePackageVersion: 4.8.0-preview-$(Build.BuildNumber) # Consumed by Microsoft.Bot.Builder.sln projects.
SlackBotToken: $(SlackTestBotSlackBotToken)
SlackChannel: $(SlackTestBotSlackChannel)
SlackClientSigningSecret: $(SlackTestBotSlackClientSigningSecret)
SlackVerificationToken: $(SlackTestBotSlackVerificationToken)
SolutionDir: $(System.DefaultWorkingDirectory) # Consumed in dotnet publish by Directory.Build.props and a few test projects.
Expand All @@ -49,7 +48,7 @@ variables:
# SlackTestBotSlackBotToken: define this in Azure
# SlackTestBotSlackChannel: define this in Azure
# SlackTestBotSlackClientSigningSecret: define this in Azure
# SlackTestBotSlackVerificationToken: define this in Azure
# SlackTestBotSlackVerificationToken: define this in Azure

steps:
- powershell: 'gci env:* | sort-object name | Format-Table -AutoSize -Wrap'
Expand All @@ -64,17 +63,6 @@ steps:
arguments: '--configuration $(BuildConfiguration) --output $(System.DefaultWorkingDirectory)\tests\Adapters\Microsoft.Bot.Builder.Adapters.Slack.TestBot\PublishedBot -p:TreatWarningsAsErrors=false'
modifyOutputPath: false

#- powershell: |
# echo '##vso[task.setvariable variable=AppId]$(SlackTestBotAppId)'
# echo '##vso[task.setvariable variable=AppSecret]$(SlackTestBotAppSecret)'
# echo '##vso[task.setvariable variable=BotGroup]$(SlackTestBotBotGroup)'
# echo '##vso[task.setvariable variable=BotName]$(SlackTestBotBotName)'
# echo '##vso[task.setvariable variable=SlackBotToken]$(SlackTestBotSlackBotToken)'
# echo '##vso[task.setvariable variable=SlackChannel]$(SlackTestBotSlackChannel)'
# echo '##vso[task.setvariable variable=SlackClientSigningSecret]$(SlackTestBotSlackClientSigningSecret)'
# echo '##vso[task.setvariable variable=SlackVerificationToken]$(SlackTestBotSlackVerificationToken)'
# displayName: 'Set Environment Variables'

- task: AzureCLI@1
displayName: 'Create resources'
inputs:
Expand Down Expand Up @@ -106,6 +94,12 @@ steps:
FunctionalTests\Microsoft.Bot.Builder.FunctionalTests\Microsoft.Bot.Builder.FunctionalTests.csproj
arguments: '-v n --configuration $(BuildConfiguration) --filter SlackClientTest'
workingDirectory: tests
env:
BotName: $(SlackTestBotBotName)
SlackBotToken: $(SlackTestBotSlackBotToken)
SlackChannel: $(SlackTestBotSlackChannel)
SlackClientSigningSecret: $(SlackTestBotSlackClientSigningSecret)
SlackVerificationToken: $(SlackTestBotSlackVerificationToken)

- task: AzureCLI@1
displayName: 'Delete Resources'
Expand Down
14 changes: 6 additions & 8 deletions build/yaml/botbuilder-dotnet-ci-twilio-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,18 @@ steps:
call az deployment create --name "$(BotGroup)" --template-file "$(System.DefaultWorkingDirectory)\tests\Adapters\Microsoft.Bot.Builder.Adapters.Twilio.TestBot\DeploymentTemplates\template-with-new-rg.json" --location "westus" --parameters appId="$(AppId)" appSecret="$(AppSecret)" botId="$(BotName)" botSku=F0 newAppServicePlanName="$(BotName)" newWebAppName="$(BotName)" groupName="$(BotGroup)" groupLocation="westus" newAppServicePlanLocation="westus" twilioNumber="$(TwilioNumber)" twilioAccountSid="$(TwilioAccountSid)" twilioAuthToken="$(TwilioAuthToken)"
call az webapp deployment source config-zip --resource-group "$(BotGroup)" --name "$(BotName)" --src "$(System.DefaultWorkingDirectory)\tests\Adapters\Microsoft.Bot.Builder.Adapters.Twilio.TestBot\PublishedBot\PublishedBot.zip"

- powershell: |
echo '##vso[task.setvariable variable=SENDER_NUMBER]$(SenderNumber)'
echo '##vso[task.setvariable variable=TWILIO_ACCOUNT_SID]$(TwilioAccountSid)'
echo '##vso[task.setvariable variable=TWILIO_NUMBER]$(TwilioNumber)'
echo '##vso[task.setvariable variable=TWILIO_AUTH_TOKEN]$(TwilioAuthToken)'
echo '##vso[task.setvariable variable=TwilioValidationUrl]https://$(BotName).azurewebsites.net/api/messages'
displayName: 'Set environment variables'

- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: '$(System.DefaultWorkingDirectory)\FunctionalTests\Microsoft.Bot.Builder.FunctionalTests\Microsoft.Bot.Builder.FunctionalTests.csproj'
arguments: '-v n --configuration $(BuildConfiguration) --filter TwilioNumberTests'
env:
SENDER_NUMBER: $(SenderNumber)
TWILIO_ACCOUNT_SID: $(TwilioAccountSid)
TWILIO_AUTH_TOKEN: $(TwilioAuthToken)
TWILIO_NUMBER: $(TwilioNumber)
TwilioValidationUrl: https://$(BotName).azurewebsites.net/api/messages

- task: AzureCLI@1
displayName: 'Delete resources'
Expand Down
10 changes: 5 additions & 5 deletions build/yaml/botbuilder-dotnet-functional-test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ steps:
displayName: 'Git bot deployment'

- powershell: |
$content = Get-Content '$(System.DefaultWorkingDirectory)\DirectLineCreate.json' | Out-String
Copy link
Contributor Author

@BruceHaley BruceHaley Sep 28, 2020

Choose a reason for hiding this comment

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

No code change here, just tidying up.

Write-Host $content
$json = $content | ConvertFrom-Json
$json = Get-Content '$(System.DefaultWorkingDirectory)\DirectLineCreate.json' | Out-String | ConvertFrom-Json
$key = $json.properties.properties.sites.key
echo "##vso[task.setvariable variable=DIRECTLINE;]$key"
echo "##vso[task.setvariable variable=BOTID;]$(LinuxTestBotBotName)"
displayName: 'Get bot keys'
Write-Host "DIRECTLINE=$key";
Write-Host "BOTID=$(LinuxTestBotBotName)";
displayName: 'Set directline key for test'

- task: DotNetCoreCLI@2
displayName: 'Run Functional tests'
displayName: 'dotnet test'
inputs:
command: test
projects: '$(System.DefaultWorkingDirectory)\FunctionalTests\**\*FunctionalTests.csproj'
Expand Down
2 changes: 1 addition & 1 deletion build/yaml/botbuilder-dotnet-functional-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ steps:
echo "##vso[task.setvariable variable=BOTID;]$(BotName)"
Write-Host "DIRECTLINE=$key";
Write-Host "BOTID=$(BotName)";
displayName: 'Set up directline keys'
displayName: 'Set directline key for test'

- task: DotNetCoreCLI@2
displayName: 'dotnet test'
Expand Down