Skip to content

Commit 058f168

Browse files
authored
Merge pull request #4 from ChangemakerStudios/claude/fix-macos-test-011CUw94dxunkREV1xPVrGD9
Fix macOS CI test failure for X509CertStore
2 parents 47be11c + 3304820 commit 058f168

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) Nate McMaster.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System.Runtime.InteropServices;
5+
using McMaster.Extensions.Xunit;
6+
7+
namespace LettuceEncrypt.UnitTests;
8+
9+
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
10+
internal class SkipOnMacOSCIBuildAttribute : Attribute, ITestCondition
11+
{
12+
public bool IsMet => string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CI"))
13+
|| !RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
14+
15+
public string SkipReason { get; set; }
16+
}

test/LettuceEncrypt.UnitTests/X509CertStoreTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public async Task ItFindsCertByCommonNameAsync()
6464
[SkippableFact]
6565
[SkipOnWindowsCIBuild(SkipReason =
6666
"On Windows in CI, adding certs to store doesn't work for unclear reasons.")]
67+
[SkipOnMacOSCIBuild(SkipReason =
68+
"On macOS in CI, adding certs to the keychain fails with 'The specified item could not be found in the keychain'.")]
6769
public async Task ItSavesCertificates()
6870
{
6971
var commonName = "x509store.save.test.natemcmaster.com";

0 commit comments

Comments
 (0)