Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit c1803e1

Browse files
Merge branch 'master' into enhancements/repository-watcher-refactor-rollup
2 parents fc52b8b + c2f64aa commit c1803e1

File tree

5 files changed

+56
-3
lines changed

5 files changed

+56
-3
lines changed

docs/contributing/how-to-test.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
Unit and Integration tests for Unity can be found under `src/tests/`.
3+
4+
## Testing requirements
5+
Tests currently run with NUnit 2.6.4.
6+
7+
## Running tests
8+
Tests can be run after building the Unity project. To run the tests execute `test.cmd` on Windows or `test.sh` on Mac.
9+
10+
We use [Appveyor](https://ci.appveyor.com/project/github-windows/unity/build/tests) as the CI for this project to run tests, but it is also necessary to run tests locally when making code changes.

src/GitHub.Api/Helpers/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ static class Constants
99
public const string UsageFile = "usage.json";
1010
public const string GitInstallPathKey = "GitInstallPath";
1111
public const string TraceLoggingKey = "EnableTraceLogging";
12-
public const string Iso8601Format = "o";
12+
public const string Iso8601Format = "yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz";
1313

1414
public static readonly Version MinimumGitVersion = new Version(2, 11, 0);
1515
public static readonly Version MinimumGitLfsVersion = new Version(2, 3, 4);

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/SettingsView.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ public override void OnEnable()
5151
userSettingsView.OnEnable();
5252
AttachHandlers(Repository);
5353

54-
Repository.CheckCurrentRemoteChangedEvent(lastCurrentRemoteChangedEvent);
55-
Repository.CheckLocksChangedEvent(lastLocksChangedEvent);
54+
if (Repository != null)
55+
{
56+
Repository.CheckCurrentRemoteChangedEvent(lastCurrentRemoteChangedEvent);
57+
Repository.CheckLocksChangedEvent(lastLocksChangedEvent);
58+
}
59+
5660
metricsHasChanged = true;
5761
}
5862

test.cmd

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@echo off
2+
setlocal
3+
4+
set Config=Debug
5+
if not %1.==. (
6+
set Config=%1
7+
)
8+
9+
set Exclude=''
10+
if not %2.==. (
11+
set Exclude=%2
12+
)
13+
14+
:: make sure at Unity project root directory
15+
set NunitDirectory=packages\NUnit.Runners.2.6.4\tools
16+
echo %NunitDirectory%
17+
set ConsoleRunner=%NunitDirectory%\nunit-console.exe
18+
echo %ConsoleRunner%
19+
20+
:: run tests
21+
echo Running "build\IntegrationTests\IntegrationTests.dll" "build\IntegrationTests\TestUtils.dll" "build\TaskSystemIntegrationTests\TaskSystemIntegrationTests.dll" "build\UnitTests\TestUtils.dll" "build\UnitTests\UnitTests.dll" "src\tests\TestUtils\bin\%Config%\TestUtils.dll" /exclude=%Exclude%
22+
call %ConsoleRunner% "build\IntegrationTests\IntegrationTests.dll" "build\IntegrationTests\TestUtils.dll" "build\TaskSystemIntegrationTests\TaskSystemIntegrationTests.dll" "build\UnitTests\TestUtils.dll" "build\UnitTests\UnitTests.dll" "src\tests\TestUtils\bin\%Config%\TestUtils.dll" /exclude=%Exclude%
23+
24+
endlocal

test.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh -eu
2+
Configuration="Debug"
3+
if [ $# -gt 0 ]; then
4+
Configuration=$1
5+
fi
6+
7+
Exclude=""
8+
if [ $# -gt 1 ]; then
9+
Exclude="/exclude=$2"
10+
fi
11+
12+
NunitDirectory="packages\NUnit.Runners.2.6.4\tools"
13+
ConsoleRunner="$NunitDirectory\nunit-console.exe"
14+
15+
$ConsoleRunner "build\IntegrationTests\IntegrationTests.dll" "build\IntegrationTests\TestUtils.dll" "build\TaskSystemIntegrationTests\TaskSystemIntegrationTests.dll" "build\UnitTests\TestUtils.dll" "build\UnitTests\UnitTests.dll" "src\tests\TestUtils\bin\\$Configuration\TestUtils.dll" $Exclude

0 commit comments

Comments
 (0)