Skip to content

Commit 6b874cd

Browse files
Update Deid tests (Azure#51165)
* Case-sensitive test data path for Linux * Updating test environment variables * env var names * Add default values for env vars --------- Co-authored-by: Josiah Vinson <[email protected]>
1 parent 86d6acc commit 6b874cd

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/Helpers/DeidentificationTestEnvironment.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,17 @@ namespace Azure.Health.Deidentification.Tests
77
{
88
public class DeidentificationTestEnvironment : TestEnvironment
99
{
10-
public string Endpoint => GetRecordedVariable("DEID_SERVICE_ENDPOINT");
11-
public string SasUri => GetRecordedVariable("SAS_URI", options => options.IsSecret());
12-
10+
public string Endpoint => GetRecordedOptionalVariable("DEID_SERVICE_ENDPOINT") ?? "https://localhost:5020";
11+
public string StorageAccountName => GetRecordedOptionalVariable("STORAGE_ACCOUNT_NAME") ?? "storageAccount";
12+
public string StorageContainerName => GetRecordedOptionalVariable("STORAGE_CONTAINER_NAME") ?? "container";
1313
public static string FakeNextLink => "https://localhost:5020/jobs/net-sdk-job-1234/documents?api-version=2024-11-15&maxpagesize=2&continuationToken=1234";
1414
public static string FakeStorageLocation => "https://fakeblobstorage.blob.core.windows.net/container";
1515
public static string FakeJobName => "net-sdk-job-1234";
1616
public static string FakeContinuationTokenSegment => "continuationToken=1234";
1717

1818
public string GetStorageAccountLocation()
1919
{
20-
if (!string.IsNullOrEmpty(SasUri))
21-
{
22-
// In playback mode, the SAS URI is sanitized to avoid sharing secrets.
23-
if (string.Equals(SasUri, "Sanitized", System.StringComparison.OrdinalIgnoreCase))
24-
{
25-
return FakeStorageLocation;
26-
}
27-
return SasUri;
28-
}
29-
return $"https://{GetRecordedVariable("STORAGE_ACCOUNT_NAME")}.blob.core.windows.net/{GetRecordedVariable("STORAGE_CONTAINER_NAME")}";
20+
return $"https://{StorageAccountName}.blob.core.windows.net/{StorageContainerName}";
3021
}
3122
}
3223
}

sdk/healthdataaiservices/test-resources-post.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $storageAccountName = $DeploymentOutputs['HEALTHDATAAISERVICES_STORAGE_ACCOUNT_N
2121
$containerName = $DeploymentOutputs['HEALTHDATAAISERVICES_STORAGE_CONTAINER_NAME']
2222

2323
# Set the local folder path to upload
24-
$localFolderPath = "$PSScriptRoot\Azure.Health.Deidentification\tests\data\example_patient_1"
24+
$localFolderPath = "$PSScriptRoot\Azure.Health.Deidentification\tests\Data\example_patient_1"
2525

2626
# Check if the connection string is present
2727
if ([string]::IsNullOrWhiteSpace($storageAccountName)) {

0 commit comments

Comments
 (0)