Skip to content

Commit 329f37d

Browse files
committed
Issue 34304: #3223 Fix Functional test failures in CI
- Added powershell script content to test error output for disgnostics.
1 parent 21da1fa commit 329f37d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/Fixtures/CertificateFixtureBase.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected static X509Certificate2 CreateCertificate(string subjectName, IEnumera
5050

5151
rnd.NextBytes(passwordBytes);
5252
password = Convert.ToBase64String(passwordBytes);
53-
#if NET || NET472_OR_GREATER
53+
#if NET
5454
X500DistinguishedNameBuilder subjectBuilder = new X500DistinguishedNameBuilder();
5555
SubjectAlternativeNameBuilder sanBuilder = new SubjectAlternativeNameBuilder();
5656
RSA rsaKey = RSA.Create(2048);
@@ -151,7 +151,9 @@ exit 1
151151
CreateNoWindow = true,
152152
// Pass the Base64-encoded command to remove the need to escape quote marks
153153
Arguments = "-EncodedCommand " + Convert.ToBase64String(Encoding.Unicode.GetBytes(formattedCommand)),
154-
Verb = "runas",
154+
// Run as Administrator, since we're manipulating the system
155+
// certificate store.
156+
Verb = "RunAs",
155157
LoadUserProfile = true
156158
}
157159
})
@@ -172,7 +174,9 @@ exit 1
172174
}
173175
else
174176
{
175-
throw new Exception($"PowerShell command raised exception: {commandOutput}");
177+
throw new Exception(
178+
"PowerShell command raised exception: " +
179+
$"{commandOutput}; command was: {formattedCommand}");
176180
}
177181
}
178182
#endif

src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="$(SystemSecurityCryptographyPkcsVersion)" />
2020
<PackageReference Include="Microsoft.Bcl.Cryptography" Version="$(MicrosoftBclCryptographyVersion)" />
2121
</ItemGroup>
22-
</Project>
22+
</Project>

0 commit comments

Comments
 (0)