CycloneDX / CycloneDX/cyclonedx-cli

Tests on MacOS fail due issue with snapshooter

Open
#368 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
541
Forks
82
PR merge metrics
No merged PRs in 30d

Description

Snapshooter tries to access "/_" instead of the full path.

See
https://github.com/SwissLife-OSS/snapshooter/issues/196

For instance,
```
Failed CycloneDX.Cli.Tests.ConvertTests.ConvertToSpdxJson(outputFormat: spdxjson) [9 ms]
Error Message:
System.UnauthorizedAccessException : Access to the path '/_/tests/cyclonedx.tests/__snapshots__' is denied.
---- System.IO.IOException : Permission denied
Stack Trace:
at System.IO.FileSystem.CreateDirectory(String fullPath)
at System.IO.Directory.CreateDirectory(String path)
at Snapshooter.Core.SnapshotFileHandler.CreateFolderIfNotExist(String folderPath)
at Snapshooter.Core.SnapshotFileHandler.EnsureSnapshotFolder(SnapshotFullName snapshotFullName)
at Snapshooter.Core.SnapshotFileHandler.ReadSnapshot(SnapshotFullName snapshotFullName)
at Snapshooter.SnapshotAssert.AssertSnapshot(Object currentResult, SnapshotFullName snapshotFullName, Func`2 matchOptions)
at Snapshooter.Snapshooter.AssertSnapshot(Object currentResult, SnapshotFullName snapshotFullName, Func`2 matchOptions)
at Snapshooter.Xunit.Snapshot.Match(Object currentResult, SnapshotFullName snapshotFullName, Func`2 matchOptions)
at Snapshooter.Xunit.Snapshot.Match(Object currentResult, SnapshotNameExtension snapshotNameExtension, Func`2 matchOptions)
at Snapshooter.Xunit.Snapshot.Match[T](T currentResult, SnapshotNameExtension snapshotNameExtension, Func`2 matchOptions)
at CycloneDX.Cli.Tests.ConvertTests.ConvertToSpdxJson(ConvertFormat outputFormat) in /_/tests/cyclonedx.tests/ConvertTests.cs:line 126
--- End of stack trace from previous location ---
```

On Windows and Linux, workarounds were merged with https://github.com/CycloneDX/cyclonedx-cli/pull/367.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.