Skip to content

Commit 887e524

Browse files
authored
Update Node Worker (#2923)
* Update node version and address change in recursive camel cased binding data * updating test for camelCase binding data * Updating to correct nodejs release and fixing tests
1 parent a47b696 commit 887e524

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed

src/WebJobs.Script/WebJobs.Script.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</PackageReference>
3131
<PackageReference Include="Microsoft.Azure.AppService.Proxy.Client" Version="2.0.5150001-beta-b9e0da04" />
3232
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="1.1.0-beta2-10041" />
33-
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="1.0.0-beta1-10031" />
33+
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="1.0.0-beta2" />
3434
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.0-beta7" />
3535
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="3.0.0-beta7" />
3636
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.0-beta7">

test/WebJobs.Script.Tests.Integration/EventHubs/EventHubsEndToEndTestsBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public async Task EventHub()
4141
var bindingData = payload["bindingData"];
4242
int sequenceNumber = (int)bindingData["sequenceNumber"];
4343
var systemProperties = bindingData["systemProperties"];
44-
Assert.Equal(sequenceNumber, (int)systemProperties["SequenceNumber"]);
44+
Assert.Equal(sequenceNumber, (int)systemProperties["sequenceNumber"]);
4545
}
4646

4747
public class TestFixture : EndToEndTestFixture

test/WebJobs.Script.Tests.Integration/ScriptHostEndToEnd/NodeContentTests.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ public async Task StringTextPlain()
6060
}
6161

6262
[Fact]
63-
public async Task BadContentType_ThrowsExpectedException_Conneg()
63+
public async Task NullContentType_Ignored_Conneg()
6464
{
65-
await Assert.ThrowsAsync<FunctionInvocationException>(async () =>
66-
{
67-
var content = await ResponseWithConneg("asdf", null);
68-
});
65+
var str = "asdf";
66+
var content = await ResponseWithConneg("asdf", null);
67+
Assert.Equal(str, content);
6968
}
7069

7170
[Fact]
@@ -342,7 +341,14 @@ protected async Task<string> CreateTest<Req>(Req content, string contentType, bo
342341
{
343342
ObjectResult objResult = result as ObjectResult;
344343
Assert.NotNull(objResult);
345-
Assert.Equal(contentType, objResult.ContentTypes[0]);
344+
if (contentType == null)
345+
{
346+
Assert.Equal(0, objResult.ContentTypes.Count);
347+
}
348+
else
349+
{
350+
Assert.Equal(contentType, objResult.ContentTypes[0]);
351+
}
346352
Assert.Equal(200, objResult.StatusCode);
347353
if (content is byte[])
348354
{

test/WebJobs.Script.Tests.Integration/TestScripts/Node/Scenarios/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var util = require('util');
22
var assert = require('assert');
33

4-
module.exports = function (context, input) {
4+
module.exports = function (context, input) {
55
var scenario = input.scenario;
66

77
if (scenario === 'nextTick') {

test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/NodeEndToEndTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ public async Task BlobTriggerToBlobTest()
6464
Assert.Equal($"test-input-node/{name}", (string)blobMetadata["path"]);
6565

6666
var metadata = (JObject)blobMetadata["metadata"];
67-
Assert.Equal("TestMetadataValue", (string)metadata["TestMetadataKey"]);
67+
Assert.Equal("TestMetadataValue", (string)metadata["testMetadataKey"]);
6868

6969
var properties = (JObject)blobMetadata["properties"];
70-
Assert.Equal("application/octet-stream", (string)properties["ContentType"]);
71-
Assert.Equal("BlockBlob", Enum.Parse(typeof(BlobType), (string)properties["BlobType"]).ToString());
72-
Assert.Equal(5, properties["Length"]);
70+
Assert.Equal("application/octet-stream", (string)properties["contentType"]);
71+
Assert.Equal("BlockBlob", Enum.Parse(typeof(BlobType), (string)properties["blobType"]).ToString());
72+
Assert.Equal(5, properties["length"]);
7373

7474
string invocationId = (string)testResult["invocationId"];
7575
Guid.Parse(invocationId);

test/WebJobs.Script.Tests.Integration/WebJobs.Script.Tests.Integration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="1.9.1" />
3030
<PackageReference Include="Microsoft.Azure.EventHubs" Version="1.0.3" />
3131
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="1.1.0-beta2-10041" />
32-
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="1.0.0-beta1-10031" />
32+
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="1.0.0-beta2" />
3333
<PackageReference Include="Microsoft.Azure.Mobile.Client" Version="4.0.2" />
3434
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="2.0.0" />
3535
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.0" />

0 commit comments

Comments
 (0)