Skip to content

Commit

Permalink
Change Assert.Inconclusive() to Assert.Fail() in tests (#4754)
Browse files Browse the repository at this point in the history
* Change Assert.Inconclusive() to Assert.Fail()

* Add #if !AUTOMATEDBUILD

* Add var TESTAPPID

* Move env vars to dotnet test task

* Change env var name to TestPassword

* Add TestAppId: $(LinuxTestBotAppId)
  • Loading branch information
BruceHaley committed Oct 6, 2020
1 parent 7fa5024 commit 540fadc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Expand Up @@ -15,7 +15,7 @@ public static string TestAppId()
var testAppId = Environment.GetEnvironmentVariable("TESTAPPID");
if (string.IsNullOrWhiteSpace(testAppId))
{
Assert.Inconclusive("Environment variable 'TestAppId' not found.");
Assert.Fail("Environment variable 'TestAppId' not found.");
}

return testAppId;
Expand All @@ -27,7 +27,7 @@ public static string TestAppPassword()

if (string.IsNullOrWhiteSpace(testPassword))
{
Assert.Inconclusive("Environment variable 'TestPassword' not found.");
Assert.Fail("Environment variable 'TestPassword' not found.");
}

return testPassword;
Expand Down
Expand Up @@ -12,6 +12,9 @@ namespace Microsoft.Bot.Builder.FunctionalTests
{
[TestClass]
[TestCategory("FunctionalTests")]
#if !AUTOMATEDBUILD
[Ignore]
#endif
public class GetTokenRefreshTests
{
private string testAppId = null;
Expand Down
3 changes: 3 additions & 0 deletions build/yaml/botbuilder-dotnet-functional-test-linux.yml
Expand Up @@ -99,6 +99,9 @@ steps:
projects: '$(System.DefaultWorkingDirectory)\FunctionalTests\**\*FunctionalTests.csproj'
arguments: '-v n --configuration $(BuildConfiguration) --filter "TestCategory=FunctionalTests&TestCategory!=Adapters" --collect:"Code Coverage" --settings $(System.DefaultWorkingDirectory)\CodeCoverage.runsettings '
workingDirectory: '$(System.DefaultWorkingDirectory)\'
env:
TestAppId: $(LinuxTestBotAppId)
TestPassword: $(LinuxTestBotAppSecret)

- task: AzureCLI@1
displayName: 'Delete test resource group'
Expand Down
3 changes: 3 additions & 0 deletions build/yaml/botbuilder-dotnet-functional-test-windows.yml
Expand Up @@ -96,6 +96,9 @@ steps:
projects: '$(System.DefaultWorkingDirectory)\FunctionalTests\**\*FunctionalTests.csproj'
arguments: '-v n --configuration $(BuildConfiguration) --filter "TestCategory=FunctionalTests&TestCategory!=Adapters"'
workingDirectory: tests
env:
TestAppId: $(WinTestBotAppId)
TestPassword: $(WinTestBotAppSecret)

- task: AzureCLI@1
displayName: 'Delete Resources'
Expand Down

0 comments on commit 540fadc

Please sign in to comment.