forked from Azure/bicep
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repro for radius issue (Azure#13773)
I couldn't repro the problem reported under Azure#13423 (comment), but figured I'd check in the work anyway, to give more coverage of Radius scenarios.
- Loading branch information
1 parent
dba7d80
commit a11a611
Showing
2 changed files
with
66 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,10 +23,8 @@ private static ServiceBuilder GetServiceBuilder(IFileSystem fileSystem, string r | |
.WithContainerRegistryClientFactory(clientFactory); | ||
} | ||
|
||
[TestMethod] | ||
public async Task Radius_identifier_passing_works_as_defined() | ||
private static async Task<ServiceBuilder> GetServicesWithPrepublishedTypes() | ||
{ | ||
// repro for https://github.com/Azure/bicep/issues/13465 | ||
var registry = "example.azurecr.io"; | ||
var repository = $"test/radius"; | ||
|
||
|
@@ -35,6 +33,15 @@ public async Task Radius_identifier_passing_works_as_defined() | |
var tgzData = ThirdPartyTypeHelper.GetMockRadiusTypesTgz(); | ||
await RegistryHelper.PublishProviderToRegistryAsync(services.Build(), $"br:{registry}/{repository}:1.0.0", tgzData); | ||
|
||
return services; | ||
} | ||
|
||
[TestMethod] | ||
public async Task Radius_identifier_passing_works_as_defined() | ||
{ | ||
// repro for https://github.com/Azure/bicep/issues/13465 | ||
var services = await GetServicesWithPrepublishedTypes(); | ||
|
||
var result = await CompilationHelper.RestoreAndCompile(services, """ | ||
provider 'br:example.azurecr.io/test/[email protected]' | ||
|
||
|
@@ -62,6 +69,30 @@ param basename string | |
} | ||
} | ||
} | ||
"""); | ||
|
||
result.ExcludingLinterDiagnostics().Should().NotHaveAnyDiagnostics(); | ||
} | ||
|
||
[TestMethod] | ||
public async Task Radius_use_of_existing_works() | ||
{ | ||
// repro for https://github.com/Azure/bicep/issues/13423#issuecomment-2030512429 | ||
var services = await GetServicesWithPrepublishedTypes(); | ||
|
||
var result = await CompilationHelper.RestoreAndCompile(services, """ | ||
provider 'br:example.azurecr.io/test/[email protected]' | ||
|
||
param bucketName string | ||
|
||
resource bucket 'AWS.S3/Bucket@default' existing = { | ||
alias: bucketName | ||
properties: { | ||
BucketName: bucketName | ||
} | ||
} | ||
|
||
output var string = bucket.properties.BucketName | ||
"""); | ||
|
||
result.ExcludingLinterDiagnostics().Should().NotHaveAnyDiagnostics(); | ||
|
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