-
Notifications
You must be signed in to change notification settings - Fork 756
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement provider declaration aliasing (#12127)
# Overview Implementation of #11598 ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/12127) --------- Co-authored-by: asilverman <[email protected]>
- Loading branch information
1 parent
e002746
commit 7bccda3
Showing
57 changed files
with
720 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -624,7 +624,7 @@ param connectionString string | |
public void Az_namespace_can_be_used_without_configuration() | ||
{ | ||
var result = CompilationHelper.Compile(Services, @" | ||
import '[email protected]' | ||
import 'br/public:[email protected]' | ||
"); | ||
|
||
result.Should().GenerateATemplate(); | ||
|
@@ -635,7 +635,7 @@ public void Az_namespace_can_be_used_without_configuration() | |
public void Az_namespace_errors_with_configuration() | ||
{ | ||
var result = CompilationHelper.Compile(Services, @" | ||
import '[email protected]' with {} | ||
import 'br/public:[email protected]' with {} | ||
"); | ||
|
||
result.Should().NotGenerateATemplate(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ public TestNamespaceProvider(Dictionary<string, Func<string, NamespaceType>> bui | |
public void Imports_are_disabled_unless_feature_is_enabled() | ||
{ | ||
var result = CompilationHelper.Compile(@" | ||
import '[email protected]' | ||
import 'br/public:[email protected]' | ||
"); | ||
result.Should().HaveDiagnostics(new[] { | ||
("BCP203", DiagnosticLevel.Error, "Using import statements requires enabling EXPERIMENTAL feature \"Extensibility\"."), | ||
|
@@ -74,7 +74,7 @@ public void Import_statement_parse_diagnostics_are_guiding() | |
}); | ||
|
||
result = CompilationHelper.Compile(ServicesWithImports, @" | ||
import '[email protected]' blahblah | ||
import 'br/public:[email protected]' blahblah | ||
"); | ||
result.Should().HaveDiagnostics(new[] { | ||
("BCP305", DiagnosticLevel.Error, "Expected the \"with\" keyword, \"as\" keyword, or a new line character at this location."), | ||
|
@@ -108,7 +108,7 @@ public void Import_statement_parse_diagnostics_are_guiding() | |
}); | ||
|
||
result = CompilationHelper.Compile(ServicesWithImports, @" | ||
import '[email protected]' as | ||
import 'br/public:[email protected]' as | ||
"); | ||
result.Should().HaveDiagnostics(new[] { | ||
("BCP202", DiagnosticLevel.Error, "Expected an import alias name at this location."), | ||
|
@@ -130,7 +130,7 @@ public void Imports_return_error_with_unrecognized_namespace() | |
public void Import_configuration_is_blocked_by_default() | ||
{ | ||
var result = CompilationHelper.Compile(ServicesWithImports, @" | ||
import '[email protected]' with { | ||
import 'br/public:[email protected]' with { | ||
foo: 'bar' | ||
} | ||
"); | ||
|
@@ -143,7 +143,7 @@ public void Import_configuration_is_blocked_by_default() | |
public void Using_import_statements_frees_up_the_namespace_symbol() | ||
{ | ||
var result = CompilationHelper.Compile(ServicesWithImports, @" | ||
import '[email protected]' as newAz | ||
import 'br/public:[email protected]' as newAz | ||
var az = 'Fake AZ!' | ||
var myRg = newAz.resourceGroup() | ||
|
@@ -159,7 +159,7 @@ public void Using_import_statements_frees_up_the_namespace_symbol() | |
public void You_can_swap_imported_namespaces_if_you_really_really_want_to() | ||
{ | ||
var result = CompilationHelper.Compile(ServicesWithImports, @" | ||
import '[email protected]' as sys | ||
import 'br/public:[email protected]' as sys | ||
import '[email protected]' as az | ||
var myRg = sys.resourceGroup() | ||
|
@@ -176,7 +176,7 @@ public void You_can_swap_imported_namespaces_if_you_really_really_want_to() | |
public void Overwriting_single_built_in_namespace_with_import_is_prohibited() | ||
{ | ||
var result = CompilationHelper.Compile(ServicesWithImports, @" | ||
import '[email protected]' as sys | ||
import 'br/public:[email protected]' as sys | ||
var myRg = sys.resourceGroup() | ||
|
@@ -190,8 +190,8 @@ public void Overwriting_single_built_in_namespace_with_import_is_prohibited() | |
public void Singleton_imports_cannot_be_used_multiple_times() | ||
{ | ||
var result = CompilationHelper.Compile(ServicesWithImports, @" | ||
import '[email protected]' as az1 | ||
import '[email protected]' as az2 | ||
import 'br/public:[email protected]' as az1 | ||
import 'br/public:[email protected]' as az2 | ||
import '[email protected]' as sys1 | ||
import '[email protected]' as sys2 | ||
|
@@ -209,7 +209,7 @@ public void Singleton_imports_cannot_be_used_multiple_times() | |
public void Import_names_must_not_conflict_with_other_symbols() | ||
{ | ||
var result = CompilationHelper.Compile(ServicesWithImports, @" | ||
import '[email protected]' | ||
import 'br/public:[email protected]' | ||
import '[email protected]' with { | ||
kubeConfig: '' | ||
namespace: '' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/Files/baselines/Modules_CRLF/child/folder with separate config/moduleWithAzImport.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import '[email protected]' | ||
import 'br/public:[email protected]' | ||
|
||
output str string = 'foo' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.