Skip to content

Working Travis build #850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dd901e8
Ignore Visual Studio Code folder
asbjornu Apr 27, 2016
4b40daf
Added missing solution files
asbjornu Apr 27, 2016
aae06d4
Use lowercase b in 'build'
asbjornu Apr 27, 2016
75459d1
Less brittle current directory
asbjornu Apr 28, 2016
a0d3884
Fixed LibGit2Sharp obsolete warnings
asbjornu Apr 28, 2016
2755fb7
Don't run 'NoMono' tests on Mono
asbjornu Apr 28, 2016
3a67f5e
Add NoMono category to tests
asbjornu Apr 28, 2016
5532f9b
Deleted meaningless test
asbjornu Apr 28, 2016
ca52c38
Deleted ProcessHelper
asbjornu Apr 28, 2016
4b809b2
Avoid multiple enumerations of assembly info files
asbjornu Apr 28, 2016
552c030
Improved exception on missing source files in TestFileSystem.Copy()
asbjornu Apr 28, 2016
da811f6
Unix and Mono proofed AssemblyInfoFileUpdate tests
asbjornu Apr 28, 2016
96a8c98
Added NoMono category to tests failing on Mono
asbjornu Apr 28, 2016
0f275de
Output nuget version number
asbjornu Apr 28, 2016
dcb75f8
Ignore compiler warning CS0414
asbjornu Apr 28, 2016
032caa9
Send output to the Console for easier debugging
asbjornu Apr 28, 2016
5a8519d
Use Path.DirectorySeparatorChar instead of backslash
asbjornu Apr 28, 2016
cbb3d1b
Reduced test to the bare minimum
asbjornu Apr 28, 2016
0bf1672
More informative exceptions from Logger
asbjornu Apr 28, 2016
8df7cf8
Don't write to the error log before it's configured.
asbjornu Apr 28, 2016
87495e3
Added support for forward slashes (unix paths) in command line arguments
asbjornu Apr 28, 2016
2422660
Add runtime switch between MSBuild and xbuild
asbjornu Apr 28, 2016
c2794d0
Move the test step to after_script
asbjornu Apr 28, 2016
5c16c08
Let's try without sudo again.
asbjornu Apr 28, 2016
897925e
Remove System.* as NuGet references
asbjornu Apr 28, 2016
4d6ea92
Upgrade Microsoft.CodeAnalysis.* from v1.0.0 to v1.2.1 and with that,…
asbjornu Apr 28, 2016
d9b1cfb
Bring back sudo and nuget self update
asbjornu Apr 28, 2016
6e97547
Kill sudo after updating nuget
asbjornu Apr 28, 2016
370047c
Let's try to sudo nuget restore, then.
asbjornu Apr 28, 2016
eb979f6
More verbosity, please.
asbjornu Apr 28, 2016
d0c711f
Define nuget version 3.4.3 as an addon
asbjornu Apr 29, 2016
2bd45c1
Removed SolutionDirectory parameter for nuget restore
asbjornu Apr 29, 2016
bbadec9
Be explicit about the nuget addon source
asbjornu Apr 29, 2016
3b25ad6
Download custom nuget.exe and use that
asbjornu Apr 29, 2016
6ad0eac
Need to exeucte .exe files with Mono, of course
asbjornu Apr 29, 2016
991aaca
Added comment regarding the odd nuget.exe download
asbjornu Apr 29, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,11 @@ site/
################

.idea
*.sln.iml
*.sln.iml


####################
# Visual Studio Code
####################

.vscode
14 changes: 9 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
language: csharp
solution: src/GitVersion.sln
sudo: true
sudo: false
before_install: # We need to download nuget.exe due to: https://github.com/travis-ci/travis-ci/issues/5932
- mkdir -p .nuget
- wget -O .nuget/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
- mono .nuget/nuget.exe
install:
- sudo nuget update -self
- nuget restore src/GitVersion.sln
- nuget install NUnit.Runners -Version 3.2.1 -OutputDirectory ./src/packages
- mono .nuget/nuget.exe restore src/GitVersion.sln -Verbosity detailed
- mono .nuget/nuget.exe install NUnit.Runners -Version 3.2.1 -OutputDirectory ./src/packages
script:
- xbuild "./src/GitVersion.sln" /property:Configuration="Debug" /verbosity:detailed
- mono --debug --runtime=v4.0.30319 ./src/packages/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe ./src/GitVersionTask.Tests/bin/Debug/GitVersionTask.Tests.dll ./src/GitVersionCore.Tests/bin/Debug/GitVersionCore.Tests.dll ./src/GitVersionTask.Tests/bin/Debug/GitVersionTask.Tests.dll ./src/GitVersionExe.Tests/bin/Debug/GitVersionExe.Tests.dll
after_script:
- mono --debug --runtime=v4.0.30319 ./src/packages/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe ./src/GitVersionTask.Tests/bin/Debug/GitVersionTask.Tests.dll ./src/GitVersionCore.Tests/bin/Debug/GitVersionCore.Tests.dll ./src/GitVersionTask.Tests/bin/Debug/GitVersionTask.Tests.dll ./src/GitVersionExe.Tests/bin/Debug/GitVersionExe.Tests.dll -where "cat != NoMono"
4 changes: 3 additions & 1 deletion src/GitVersion.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersionExe", "GitVersionExe\GitVersionExe.csproj", "{C3578A7B-09A6-4444-9383-0DEAFA4958BD}"
EndProject
Expand All @@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersionCore.Tests", "Git
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EFFC5D6-88D0-49D9-BB53-E1B7EB49DD45}"
ProjectSection(SolutionItems) = preProject
..\.gitattributes = ..\.gitattributes
..\.gitignore = ..\.gitignore
..\.travis.yml = ..\.travis.yml
..\appveyor.yml = ..\appveyor.yml
..\BREAKING CHANGES.md = ..\BREAKING CHANGES.md
Expand Down
2 changes: 2 additions & 0 deletions src/GitVersionCore.Tests/ConfigProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ public void NextVersionCanHavePatch()
}

[Test]
[Category("NoMono")]
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
[MethodImpl(MethodImplOptions.NoInlining)]
public void CanWriteOutEffectiveConfiguration()
{
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionCore.Tests/DocumentationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void VariableDocumentationIsUpToDate()

static string ReadDocumentationFile(string relativeDocumentationFilePath)
{
var currentDirectory = new DirectoryInfo(Environment.CurrentDirectory);
var currentDirectory = new FileInfo(typeof(DocumentationTests).Assembly.Location).Directory;
while (currentDirectory != null)
{
var docsDirectory = currentDirectory
Expand Down
12 changes: 7 additions & 5 deletions src/GitVersionCore.Tests/ExecuteCoreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
using GitTools.Testing;
using GitVersion;
using GitVersion.Helpers;

using NUnit.Framework;

using Shouldly;

[TestFixture]
Expand Down Expand Up @@ -107,7 +105,7 @@ public void ConfigChangeInvalidatesCache()
fileSystem.WriteAllText(vv.FileName, versionCacheFileContent);
vv = versionAndBranchFinder.ExecuteGitVersion(null, null, null, null, false, fixture.RepositoryPath, null);
vv.AssemblySemVer.ShouldBe("4.10.3.0");

var configPath = Path.Combine(fixture.RepositoryPath, "GitVersionConfig.yaml");
fileSystem.WriteAllText(configPath, "next-version: 5.0");

Expand All @@ -121,10 +119,14 @@ string RepositoryScope(ExecuteCore executeCore = null, Action<EmptyRepositoryFix
// Make sure GitVersion doesn't trigger build server mode when we are running the tests
Environment.SetEnvironmentVariable("APPVEYOR", null);
var infoBuilder = new StringBuilder();
Action<string> infoLogger = s => { infoBuilder.AppendLine(s); };
Action<string> infoLogger = s =>
{
infoBuilder.AppendLine(s);
Console.WriteLine(s);
};
executeCore = executeCore ?? new ExecuteCore(fileSystem);

Logger.SetLoggers(infoLogger, s => { }, s => { });
Logger.SetLoggers(infoLogger, Console.WriteLine, Console.WriteLine);

using (var fixture = new EmptyRepositoryFixture())
{
Expand Down
2 changes: 2 additions & 0 deletions src/GitVersionCore.Tests/Init/InitScenarios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
public class InitScenarios
{
[Test]
[Category("NoMono")]
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
public void CanSetNextVersion()
{
var testFileSystem = new TestFileSystem();
Expand Down
4 changes: 2 additions & 2 deletions src/GitVersionCore.Tests/IntegrationTests/OtherScenarios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void DoNotBlowUpWhenMasterAndDevelopPointAtSameCommit()
fixture.Repository.MakeACommit();
fixture.Repository.CreateBranch("develop");

fixture.LocalRepositoryFixture.Repository.Network.Fetch(fixture.LocalRepositoryFixture.Repository.Network.Remotes.First());
Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, new string[0], new FetchOptions(), null);
fixture.LocalRepositoryFixture.Repository.Checkout(fixture.Repository.Head.Tip);
fixture.LocalRepositoryFixture.Repository.Branches.Remove("master");
fixture.InitialiseRepo();
Expand Down Expand Up @@ -81,7 +81,7 @@ public void DoNotBlowUpWhenDevelopAndFeatureBranchPointAtSameCommit()
fixture.Repository.MakeACommit();
fixture.Repository.CreateBranch("feature/someFeature");

fixture.LocalRepositoryFixture.Repository.Network.Fetch(fixture.LocalRepositoryFixture.Repository.Network.Remotes.First());
Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, new string[0], new FetchOptions(), null);
fixture.LocalRepositoryFixture.Repository.Checkout(fixture.Repository.Head.Tip);
fixture.LocalRepositoryFixture.Repository.Branches.Remove("master");
fixture.InitialiseRepo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void GivenARemoteGitRepositoryAheadOfLocalRepository_ThenChangesShouldPul
fixture.AssertFullSemver("0.1.0+5");
fixture.AssertFullSemver("0.1.0+4", fixture.LocalRepositoryFixture.Repository);
var buildSignature = fixture.LocalRepositoryFixture.Repository.Config.BuildSignature(new DateTimeOffset(DateTime.Now));
fixture.LocalRepositoryFixture.Repository.Network.Pull(buildSignature, new PullOptions());
Commands.Pull((Repository) fixture.LocalRepositoryFixture.Repository, buildSignature, new PullOptions());
fixture.AssertFullSemver("0.1.0+5", fixture.LocalRepositoryFixture.Repository);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/GitVersionCore.Tests/JsonVersionBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
public class JsonVersionBuilderTests
{
[Test]
[Category("NoMono")]
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
public void Json()
{
var semanticVersion = new SemanticVersion
Expand Down
7 changes: 6 additions & 1 deletion src/GitVersionCore.Tests/TestFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ public void Copy(string @from, string to, bool overwrite)
else
throw new IOException("File already exists");
}
fileSystem.Add(to, fileSystem[from]);

string source;
if (!fileSystem.TryGetValue(from, out source))
throw new FileNotFoundException(string.Format("The source file '{0}' was not found", from), from);

fileSystem.Add(to, source);
}

public void Move(string @from, string to)
Expand Down
12 changes: 12 additions & 0 deletions src/GitVersionCore.Tests/VariableProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
public class VariableProviderTests
{
[Test]
[Category("NoMono")]
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
public void ProvidesVariablesInContinuousDeliveryModeForPreRelease()
{
var semVer = new SemanticVersion
Expand All @@ -31,6 +33,8 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreRelease()
}

[Test]
[Category("NoMono")]
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding()
{
var semVer = new SemanticVersion
Expand All @@ -54,6 +58,8 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding()
}

[Test]
[Category("NoMono")]
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
public void ProvidesVariablesInContinuousDeploymentModeForPreRelease()
{
var semVer = new SemanticVersion
Expand All @@ -76,6 +82,8 @@ public void ProvidesVariablesInContinuousDeploymentModeForPreRelease()
}

[Test]
[Category("NoMono")]
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
public void ProvidesVariablesInContinuousDeliveryModeForStable()
{
var semVer = new SemanticVersion
Expand All @@ -97,6 +105,8 @@ public void ProvidesVariablesInContinuousDeliveryModeForStable()
}

[Test]
[Category("NoMono")]
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
public void ProvidesVariablesInContinuousDeploymentModeForStable()
{
var semVer = new SemanticVersion
Expand All @@ -118,6 +128,8 @@ public void ProvidesVariablesInContinuousDeploymentModeForStable()
}

[Test]
[Category("NoMono")]
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
public void ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged()
{
var semVer = new SemanticVersion
Expand Down
1 change: 0 additions & 1 deletion src/GitVersionCore/GitVersionCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
<Compile Include="GitVersionCache.cs" />
<Compile Include="Helpers\FileSystem.cs" />
<Compile Include="Helpers\IFileSystem.cs" />
<Compile Include="Helpers\ProcessHelper.cs" />
<Compile Include="Helpers\ServiceMessageEscapeHelper.cs" />
<Compile Include="IncrementStrategyFinder.cs" />
<Compile Include="OutputVariables\VersionVariables.cs" />
Expand Down
154 changes: 0 additions & 154 deletions src/GitVersionCore/Helpers/ProcessHelper.cs

This file was deleted.

4 changes: 2 additions & 2 deletions src/GitVersionCore/LibGitExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ public static string GetRepositoryDirectory(this IRepository repository, bool om
{
var gitDirectory = repository.Info.Path;

gitDirectory = gitDirectory.TrimEnd('\\');
gitDirectory = gitDirectory.TrimEnd(Path.DirectorySeparatorChar);

if (omitGitPostFix && gitDirectory.EndsWith(".git"))
{
gitDirectory = gitDirectory.Substring(0, gitDirectory.Length - ".git".Length);
gitDirectory = gitDirectory.TrimEnd('\\');
gitDirectory = gitDirectory.TrimEnd(Path.DirectorySeparatorChar);
}

return gitDirectory;
Expand Down
Loading