From 2ee986fc7ec49cc3d7fd43225e2678e92a6a538b Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Tue, 3 Dec 2024 07:16:59 +0000 Subject: [PATCH] Do not skip AZ signing test in CI --- test/PathHelper.cs | 2 ++ test/Velopack.Packaging.Tests/TrustedSigningTests.cs | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/PathHelper.cs b/test/PathHelper.cs index 9c965877..6ef93a7d 100644 --- a/test/PathHelper.cs +++ b/test/PathHelper.cs @@ -3,6 +3,8 @@ using Velopack; public static class PathHelper { + public static bool IsCI => Environment.GetEnvironmentVariable("CI") != null; + public static string GetFixturesDir() => Path.Combine(GetTestRoot(), "fixtures"); diff --git a/test/Velopack.Packaging.Tests/TrustedSigningTests.cs b/test/Velopack.Packaging.Tests/TrustedSigningTests.cs index 022648b5..39df99d4 100644 --- a/test/Velopack.Packaging.Tests/TrustedSigningTests.cs +++ b/test/Velopack.Packaging.Tests/TrustedSigningTests.cs @@ -40,15 +40,14 @@ public class TrustedSigningTests public async void CanSignWithTrustedSigning() { Skip.IfNot(VelopackRuntimeInfo.IsWindows, "Only supported on Windows"); - Skip.IfNot(await IsAuthenticatedForCodeSigningAsync(), "Sign in with az login first"); + + if (!PathHelper.IsCI) { + Skip.IfNot(await IsAuthenticatedForCodeSigningAsync(), "Sign in with az login first"); + } using var logger = _output.BuildLoggerFor(); using var _ = TempUtil.GetTempDirectory(out var releaseDir); - string channel = string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("CI")) - ? VelopackRuntimeInfo.SystemOs.GetOsShortName() - : "ci-" + VelopackRuntimeInfo.SystemOs.GetOsShortName(); - string metadataFile = Path.Combine(releaseDir, "metadata.json"); File.WriteAllText( metadataFile, @@ -67,7 +66,6 @@ public class TrustedSigningTests $"aztrusted-{DateTime.UtcNow.ToLongDateString()}", releaseDir, logger, - channel: channel, azureTrustedSignFile: metadataFile); var files = Directory.EnumerateFiles(releaseDir)