Skip to content

Commit 16d0118

Browse files
authored
Fix Integration Tests in Builds (#224)
* Tweak condition in outputdatareceived * Wait for new message * Go to 4.0.4 for Storage package * redo 5.0 * Add 60 second wait, add logging * Always start Azurite * Remove unnecessary logging * Look for api url instead of functions string
1 parent 2a58c7e commit 16d0118

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

test/Integration/IntegrationTestBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public class IntegrationTestBase : IDisposable
6060
public IntegrationTestBase(ITestOutputHelper output)
6161
{
6262
this.TestOutput = output;
63-
6463
this.SetupDatabase();
64+
this.StartAzurite();
6565
}
6666

6767
/// <summary>
@@ -193,13 +193,13 @@ protected void StartFunctionHost(string functionName, bool useTestFolder = false
193193
{
194194
// This string is printed after the function host is started up - use this to ensure that we wait long enough
195195
// since sometimes the host can take a little while to fully start up
196-
if (e.Data.Contains("Job host started"))
196+
if (e != null && !string.IsNullOrEmpty(e.Data) && e.Data.Contains($"http://localhost:{this.Port}/api"))
197197
{
198198
taskCompletionSource.SetResult(true);
199199
}
200200
};
201201
this.TestOutput.WriteLine($"Waiting for Azure Function host to start...");
202-
taskCompletionSource.Task.Wait();
202+
taskCompletionSource.Task.Wait(60000);
203203
this.TestOutput.WriteLine($"Azure Function host started!");
204204
}
205205

test/Integration/SqlOutputBindingIntegrationTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ public void QueueTriggerProductsTest()
102102
[Fact]
103103
public void TimerTriggerProductsTest()
104104
{
105-
// Timer trigger function requires local storage to be running
106-
this.StartAzurite();
107105
this.StartFunctionHost(nameof(TimerTriggerProducts));
108106

109107
// Since this function runs on a schedule (every 5 seconds), we don't need to invoke it.

0 commit comments

Comments
 (0)