-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Snapper to create snapshot if none exists (#71)
* Updated Snapper to create snapshot if none exists * Update test projects to .net core 3.1 * Bump appveyor image to VS 2019 * Fix bug with updating snapshots in CI env * Update docs to mention auto creating of initial snapshot * Update test projects to use .net 452 so that the latest xunit works * Remove appveyor logging as its not possible to make it work perfectly For NUnit tests to be logged in appveyor you need to the use the AppVeyor logger. Unfortunately since we run the same test twice, once for .net core and once for .net framework the AppVeyor logger doesn't detect the difference and only logs the test once, which results in incorrect numbers. Removed AppVeyor logger fully and not going to rely on the number in CI.
- Loading branch information
Showing
15 changed files
with
209 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Snapper.Core | ||
{ | ||
internal static class CiEnvironmentDetector | ||
{ | ||
/// <summary> | ||
/// Based on https://github.com/watson/ci-info/blob/2012259979fc38517f8e3fc74daff714251b554d/index.js#L52-L59 | ||
/// </summary> | ||
private static IEnumerable<string> CIEnvironmentVariables = new List<string> | ||
{ | ||
"CI", // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari | ||
"CONTINUOUS_INTEGRATION", // Travis CI, Cirrus CI | ||
"BUILD_NUMBER", // Jenkins, TeamCity | ||
"BUILD_BUILDNUMBER", // Azure DevOps | ||
"RUN_ID" // TaskCluster, dsari | ||
}; | ||
|
||
public static bool IsCiEnv() | ||
{ | ||
foreach (var envVarTarget in new[] { EnvironmentVariableTarget.Process, EnvironmentVariableTarget.Machine, EnvironmentVariableTarget.User }) | ||
{ | ||
var found = CIEnvironmentVariables.Any(ciEnvironmentVariable => | ||
Environment.GetEnvironmentVariable(ciEnvironmentVariable, envVarTarget) != null); | ||
if (found) | ||
{ | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
project/Tests/Snapper.Internals.Tests/Snapper.Internals.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.