Skip to content

Commit

Permalink
Update Node Worker (#2923)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mhoeger authored Jun 5, 2018
1 parent a47b696 commit 887e524
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/WebJobs.Script/WebJobs.Script.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</PackageReference>
<PackageReference Include="Microsoft.Azure.AppService.Proxy.Client" Version="2.0.5150001-beta-b9e0da04" />
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="1.1.0-beta2-10041" />
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="1.0.0-beta1-10031" />
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="1.0.0-beta2" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.0-beta7" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="3.0.0-beta7" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.0-beta7">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task EventHub()
var bindingData = payload["bindingData"];
int sequenceNumber = (int)bindingData["sequenceNumber"];
var systemProperties = bindingData["systemProperties"];
Assert.Equal(sequenceNumber, (int)systemProperties["SequenceNumber"]);
Assert.Equal(sequenceNumber, (int)systemProperties["sequenceNumber"]);
}

public class TestFixture : EndToEndTestFixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ public async Task StringTextPlain()
}

[Fact]
public async Task BadContentType_ThrowsExpectedException_Conneg()
public async Task NullContentType_Ignored_Conneg()
{
await Assert.ThrowsAsync<FunctionInvocationException>(async () =>
{
var content = await ResponseWithConneg("asdf", null);
});
var str = "asdf";
var content = await ResponseWithConneg("asdf", null);
Assert.Equal(str, content);
}

[Fact]
Expand Down Expand Up @@ -342,7 +341,14 @@ protected async Task<string> CreateTest<Req>(Req content, string contentType, bo
{
ObjectResult objResult = result as ObjectResult;
Assert.NotNull(objResult);
Assert.Equal(contentType, objResult.ContentTypes[0]);
if (contentType == null)
{
Assert.Equal(0, objResult.ContentTypes.Count);
}
else
{
Assert.Equal(contentType, objResult.ContentTypes[0]);
}
Assert.Equal(200, objResult.StatusCode);
if (content is byte[])
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var util = require('util');
var assert = require('assert');

module.exports = function (context, input) {
module.exports = function (context, input) {
var scenario = input.scenario;

if (scenario === 'nextTick') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public async Task BlobTriggerToBlobTest()
Assert.Equal($"test-input-node/{name}", (string)blobMetadata["path"]);

var metadata = (JObject)blobMetadata["metadata"];
Assert.Equal("TestMetadataValue", (string)metadata["TestMetadataKey"]);
Assert.Equal("TestMetadataValue", (string)metadata["testMetadataKey"]);

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

string invocationId = (string)testResult["invocationId"];
Guid.Parse(invocationId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="1.9.1" />
<PackageReference Include="Microsoft.Azure.EventHubs" Version="1.0.3" />
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="1.1.0-beta2-10041" />
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="1.0.0-beta1-10031" />
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="1.0.0-beta2" />
<PackageReference Include="Microsoft.Azure.Mobile.Client" Version="4.0.2" />
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.0" />
Expand Down

0 comments on commit 887e524

Please sign in to comment.