Skip to content

Commit

Permalink
Merge branch 'main' into jeskew/14067
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Bicep.Core.IntegrationTests/ScenarioTests.cs
  • Loading branch information
jeskew committed Jan 3, 2025
2 parents 2c339b9 + 3e1c6d7 commit bdfb39c
Show file tree
Hide file tree
Showing 53 changed files with 1,136 additions and 1,238 deletions.
112 changes: 56 additions & 56 deletions src/Bicep.Cli.E2eTests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Bicep.Cli.E2eTests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"@types/cross-spawn": "^6.0.6",
"@types/eslint__js": "^8.42.3",
"@types/uuid": "^10.0.0",
"@vitest/eslint-plugin": "^1.1.20",
"@vitest/eslint-plugin": "^1.1.21",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.6",
"eslint": "^9.17.0",
"eslint-plugin-notice": "^1.0.0",
"prettier": "^3.4.2",
"rimraf": "^6.0.1",
"typescript": "~5.7.2",
"typescript-eslint": "^8.18.1",
"typescript-eslint": "^8.18.2",
"uuid": "^11.0.3",
"vitest": "^2.1.8",
"vscode-jsonrpc": "^8.2.1"
Expand Down
48 changes: 48 additions & 0 deletions src/Bicep.Cli.IntegrationTests/CliScenarioTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Bicep.Core.FileSystem;
using Bicep.Core.UnitTests.Assertions;
using Bicep.Core.UnitTests.Utils;
using FluentAssertions;
using FluentAssertions.Execution;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Bicep.Cli.IntegrationTests
Expand Down Expand Up @@ -187,5 +189,51 @@ param roleAssignmentName string
""");
}

[TestMethod]
public async Task Test_Issue13785()
{
var paramFile =
"""
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"foo": {
"value": "bar"
}
}
}
""";
var expectedOutput =
"""
using '../main.bicep'
param foo = 'bar'
""";

var (jsonPath, bicepparamPath) = Setup(TestContext, paramFile);
Directory.SetCurrentDirectory(Path.GetDirectoryName(jsonPath)!);
var (output, _, result) = await Bicep("decompile-params", jsonPath, "--bicep-file", "../main.bicep");

using (new AssertionScope())
{
output.Should().BeEmpty();
result.Should().Be(0);
File.ReadAllText(bicepparamPath).Should().BeEquivalentToIgnoringNewlines(expectedOutput);
}
}

private static (string jsonPath, string bicepparamPath) Setup(TestContext context, string template, string? inputFile = null, string? outputDir = null)
{
var jsonPath = FileHelper.SaveResultFile(context, inputFile ?? "param.json", template);

var bicepparamPath = outputDir is null
? PathHelper.GetDefaultDecompileparamOutputPath(jsonPath)
: FileHelper.GetResultFilePath(context, outputDir);

return (jsonPath, bicepparamPath);
}
}
}
32 changes: 16 additions & 16 deletions src/Bicep.Cli.IntegrationTests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,29 +284,29 @@
},
"Google.Protobuf": {
"type": "Transitive",
"resolved": "3.29.1",
"contentHash": "kDFLP72bPu4GwquVN7HtFnfqxhQs4CLbUEyOc/0yV48HB0Pxf7tDK7zIx6ifaQwGp+RSoLY1sz1CXqoAEAu+AQ=="
"resolved": "3.29.2",
"contentHash": "98gc5v6WTfvfo6nXXUFyXOwwfehUGVn4tIis3AnCZabur8t6Eq0lo4eloWEYpdxPH9MrhnbAzHcMwPCS8lCWoQ=="
},
"Grpc.Core.Api": {
"type": "Transitive",
"resolved": "2.66.0",
"contentHash": "HsjsQVAHe4hqP4t4rpUnmq+MZvPdyrlPsWF4T5fbMvyP3o/lMV+KVJfDlaNH8+v0aGQTVT3EsDFufbhaWb52cw=="
"resolved": "2.67.0",
"contentHash": "cL1/2f8kc8lsAGNdfCU25deedXVehhLA6GXKLLN4hAWx16XN7BmjYn3gFU+FBpir5yJynvDTHEypr3Tl0j7x/Q=="
},
"Grpc.Net.Client": {
"type": "Transitive",
"resolved": "2.66.0",
"contentHash": "GwkSsssXFgN9+M2U+UQWdErf61sn1iqgP+2NRBlDXATcP9vlxda0wySxd/eIL8U522+SnyFNUXlvQ5tAzGk9cA==",
"resolved": "2.67.0",
"contentHash": "ofTjJQfegWkVlk5R4k/LlwpcucpsBzntygd4iAeuKd/eLMkmBWoXN+xcjYJ5IibAahRpIJU461jABZvT6E9dwA==",
"dependencies": {
"Grpc.Net.Common": "2.66.0",
"Grpc.Net.Common": "2.67.0",
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
}
},
"Grpc.Net.Common": {
"type": "Transitive",
"resolved": "2.66.0",
"contentHash": "YJpQpIvpo0HKlsG6SHwaieyji08qfv0DdEDIewCAA0egQY08637sHOj1netLGUhzBEsCqlGC3e92TZ2uqhxnvw==",
"resolved": "2.67.0",
"contentHash": "gazn1cD2Eol0/W5ZJRV4PYbNrxJ9oMs8pGYux5S9E4MymClvl7aqYSmpqgmWAUWvziRqK9K+yt3cjCMfQ3x/5A==",
"dependencies": {
"Grpc.Core.Api": "2.66.0"
"Grpc.Core.Api": "2.67.0"
}
},
"Humanizer.Core": {
Expand Down Expand Up @@ -347,10 +347,10 @@
},
"JsonPath.Net": {
"type": "Transitive",
"resolved": "1.1.6",
"contentHash": "FQLbFJdjIa70GdYGR3RpdGkLTMZwQCqcd8gC35yx6aGofVEP3QxMvSuXHn75N30jj9SS6yvsPPTDzJmPMt/Mdw==",
"resolved": "2.0.1",
"contentHash": "St/l0QIkHSqUNKqQ8iT1yvbJUpTFH1kl5V1zlU+aY8gxU0VKszMNL9qfgT4QvWGICfInh17NgBSFDF5RH38Emw==",
"dependencies": {
"Json.More.Net": "2.0.2"
"Json.More.Net": "2.1.0"
}
},
"JsonPointer.Net": {
Expand Down Expand Up @@ -1591,7 +1591,7 @@
"Azure.ResourceManager.Resources": "[1.9.0, )",
"Bicep.IO": "[1.0.0, )",
"JsonPatch.Net": "[3.2.3, )",
"JsonPath.Net": "[1.1.6, )",
"JsonPath.Net": "[2.0.1, )",
"Microsoft.Extensions.Configuration": "[9.0.0, )",
"Microsoft.Extensions.Configuration.Binder": "[9.0.0, )",
"Microsoft.Extensions.Configuration.Json": "[9.0.0, )",
Expand Down Expand Up @@ -1626,8 +1626,8 @@
"type": "Project",
"dependencies": {
"CommandLineParser": "[2.9.1, )",
"Google.Protobuf": "[3.29.1, )",
"Grpc.Net.Client": "[2.66.0, )"
"Google.Protobuf": "[3.29.2, )",
"Grpc.Net.Client": "[2.67.0, )"
}
},
"bicep": {
Expand Down
Loading

0 comments on commit bdfb39c

Please sign in to comment.