{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/core-setup/pulls/comments/66351724","id":66351724,"diff_hunk":"@@ -0,0 +1,362 @@\n+﻿using Microsoft.DotNet.Cli.Build;\n+using System;\n+using System.Collections.Generic;\n+using System.IO;\n+\n+namespace Microsoft.DotNet.CoreSetup.Test\n+{\n+    public class TestProjectFixture\n+    {\n+        private static readonly string s_testArtifactDirectoryEnvironmentVariable = \"TEST_ARTIFACTS\";\n+\n+        private string _testProjectName;\n+        private string _exeExtension;\n+        private string _sharedLibraryExtension;\n+        private string _sharedLibraryPrefix;\n+        private string _testProjectSourceDirectory;\n+        private string _testArtifactDirectory;\n+        private string _currentRid;\n+\n+        private RepoDirectoriesProvider _repoDirectoriesProvider;\n+\n+        private DotNetCli _sdkDotnet;\n+        private DotNetCli _builtDotnet;\n+\n+        private TestProject _sourceTestProject;\n+        private TestProject _testProject;\n+\n+        public DotNetCli SdkDotnet => _sdkDotnet;\n+        public DotNetCli BuiltDotnet => _builtDotnet;\n+        public TestProject TestProject => _testProject;\n+        public string CurrentRid => _currentRid;\n+\n+\n+        public TestProjectFixture(\n+            string testProjectName,\n+            RepoDirectoriesProvider repoDirectoriesProvider,\n+            string exeExtension = null,\n+            string sharedLibraryExtension = null,\n+            string sharedLibraryPrefix= null,\n+            string testProjectSourceDirectory = null,\n+            string testArtifactDirectory = null,\n+            string dotnetInstallPath = null,\n+            string currentRid = null,\n+            string builtDotnetOutputPath = null)\n+        {\n+            ValidateRequiredDirectories(repoDirectoriesProvider);\n+\n+            _testProjectName = testProjectName;\n+\n+            _exeExtension = exeExtension ?? RuntimeInformationExtensions.GetExeExtensionForCurrentOSPlatform();\n+            _sharedLibraryExtension = sharedLibraryExtension \n+                ?? RuntimeInformationExtensions.GetSharedLibraryExtensionForCurrentPlatform();\n+            _sharedLibraryPrefix = sharedLibraryPrefix \n+                ?? RuntimeInformationExtensions.GetSharedLibraryPrefixForCurrentPlatform();\n+\n+            _repoDirectoriesProvider = repoDirectoriesProvider;\n+\n+            _testProjectSourceDirectory = testProjectSourceDirectory\n+                ?? Path.Combine(repoDirectoriesProvider.RepoRoot, \"TestAssets\", \"TestProjects\");\n+            _testArtifactDirectory = _testArtifactDirectory\n+                ?? Environment.GetEnvironmentVariable(s_testArtifactDirectoryEnvironmentVariable)\n+                ?? Path.Combine(AppContext.BaseDirectory, s_testArtifactDirectoryEnvironmentVariable);\n+\n+            _sdkDotnet = new DotNetCli(dotnetInstallPath ?? DotNetCli.GetStage0Path(repoDirectoriesProvider.RepoRoot));\n+            _currentRid = currentRid ?? _sdkDotnet.GetRuntimeId();\n+            \n+            _builtDotnet = new DotNetCli(repoDirectoriesProvider.BuiltDotnet);\n+\n+            InitializeTestProject(\n+                _testProjectName,\n+                _testProjectSourceDirectory, \n+                _testArtifactDirectory,\n+                _exeExtension,\n+                _sharedLibraryExtension,\n+                _sharedLibraryPrefix);\n+        }\n+\n+        public TestProjectFixture(TestProjectFixture fixtureToCopy)\n+        {\n+            _testProjectName = fixtureToCopy._testProjectName;\n+            _exeExtension = fixtureToCopy._exeExtension;\n+            _sharedLibraryExtension = fixtureToCopy._sharedLibraryExtension;\n+            _sharedLibraryPrefix = fixtureToCopy._sharedLibraryPrefix;\n+            _repoDirectoriesProvider = fixtureToCopy._repoDirectoriesProvider;\n+            _testProjectSourceDirectory = fixtureToCopy._testProjectSourceDirectory;\n+            _testArtifactDirectory = fixtureToCopy._testArtifactDirectory;\n+            _sdkDotnet = fixtureToCopy._sdkDotnet;\n+            _currentRid = fixtureToCopy._currentRid;\n+            _builtDotnet = fixtureToCopy._builtDotnet;\n+            _sourceTestProject = fixtureToCopy._sourceTestProject;\n+\n+            _testProject = CopyTestProject(\n+                fixtureToCopy.TestProject, \n+                _testArtifactDirectory, \n+                _exeExtension,\n+                _sharedLibraryExtension,\n+                _sharedLibraryPrefix);\n+        }\n+\n+        private void InitializeTestProject(\n+            string testProjectName,\n+            string testProjectSourceDirectory,\n+            string testArtifactDirectory,\n+            string exeExtension,\n+            string sharedLibraryExtension,\n+            string sharedLibraryPrefix)\n+        {\n+            var sourceTestProjectPath = Path.Combine(testProjectSourceDirectory, testProjectName);\n+            _sourceTestProject = new TestProject(\n+                sourceTestProjectPath,\n+                exeExtension,\n+                sharedLibraryExtension,\n+                sharedLibraryPrefix);\n+\n+            _testProject = CopyTestProject(","path":"test/TestUtils/TestProjectFixture.cs","position":115,"original_position":115,"commit_id":"1ff3dff21c8eb43dadeafd03e6da37080e5c3fff","original_commit_id":"bb70f047248b47ee48eaef5a0057221e5133a549","user":{"login":"brthor","id":14280892,"avatar_url":"https://avatars.githubusercontent.com/u/14280892?v=3","gravatar_id":"","url":"https://api.github.com/users/brthor","html_url":"https://github.com/brthor","followers_url":"https://api.github.com/users/brthor/followers","following_url":"https://api.github.com/users/brthor/following{/other_user}","gists_url":"https://api.github.com/users/brthor/gists{/gist_id}","starred_url":"https://api.github.com/users/brthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brthor/subscriptions","organizations_url":"https://api.github.com/users/brthor/orgs","repos_url":"https://api.github.com/users/brthor/repos","events_url":"https://api.github.com/users/brthor/events{/privacy}","received_events_url":"https://api.github.com/users/brthor/received_events","type":"User","site_admin":false},"body":"> TestTargets.CopyTestProjectsToArtifacts\r\n\r\nI don't actually think this is relevant anymore, will remove it. The first time a TestProjectFixture is created it creates a copy of the one in TestAssets/TestProjects, builds it, and ensures it is restored. This is then copied and mutated for specific scenarios. The first copy may not be necessary but keeps test runs isolated inside the artifacts folder.\r\n\r\n---\r\nIn reply to: [66347830](https://github.com/dotnet/core-setup/pull/97#discussion_r66347830) [](ancestors = 66347830)","created_at":"2016-06-08T22:24:46Z","updated_at":"2016-06-08T22:24:46Z","html_url":"https://github.com/dotnet/core-setup/pull/97#discussion_r66351724","pull_request_url":"https://api.github.com/repos/dotnet/core-setup/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/dotnet/core-setup/pulls/comments/66351724"},"html":{"href":"https://github.com/dotnet/core-setup/pull/97#discussion_r66351724"},"pull_request":{"href":"https://api.github.com/repos/dotnet/core-setup/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/core-setup/pulls/97","id":72780268,"html_url":"https://github.com/dotnet/core-setup/pull/97","diff_url":"https://github.com/dotnet/core-setup/pull/97.diff","patch_url":"https://github.com/dotnet/core-setup/pull/97.patch","issue_url":"https://api.github.com/repos/dotnet/core-setup/issues/97","number":97,"state":"open","locked":false,"title":"Core setup tests","user":{"login":"brthor","id":14280892,"avatar_url":"https://avatars.githubusercontent.com/u/14280892?v=3","gravatar_id":"","url":"https://api.github.com/users/brthor","html_url":"https://github.com/brthor","followers_url":"https://api.github.com/users/brthor/followers","following_url":"https://api.github.com/users/brthor/following{/other_user}","gists_url":"https://api.github.com/users/brthor/gists{/gist_id}","starred_url":"https://api.github.com/users/brthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brthor/subscriptions","organizations_url":"https://api.github.com/users/brthor/orgs","repos_url":"https://api.github.com/users/brthor/repos","events_url":"https://api.github.com/users/brthor/events{/privacy}","received_events_url":"https://api.github.com/users/brthor/received_events","type":"User","site_admin":false},"body":"Will fix #33 and #34 \r\n\r\nWorking base set of tests and test fixture so we can write more tests. \r\n\r\nTested Scenarios:\r\nStandalone Published and Built App Activation with built host\r\nPortable Published and Built App Activation with built host (with --depsfile, --runtimeconfig, --additionalprobingpath permutations)\r\nDotnet-test-xunit Standalone and Portable TestApp Scenarios.\r\n\r\nMethods of Running Tests:\r\n`build.cmd --targets Prepare,Test`\r\n`dotnet test` on command line\r\n`Visual Studio Preview bits`\r\n\r\nPTAL @schellap @eerhardt @livarcocc @piotrpMSFT \r\n","created_at":"2016-06-06T21:22:32Z","updated_at":"2016-06-08T22:24:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc0f85734a2110fcc048fb0bf766f7f58802c104","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/core-setup/pulls/97/commits","review_comments_url":"https://api.github.com/repos/dotnet/core-setup/pulls/97/comments","review_comment_url":"https://api.github.com/repos/dotnet/core-setup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/core-setup/issues/97/comments","statuses_url":"https://api.github.com/repos/dotnet/core-setup/statuses/1ff3dff21c8eb43dadeafd03e6da37080e5c3fff","head":{"label":"brthor:core-setup-tests","ref":"core-setup-tests","sha":"1ff3dff21c8eb43dadeafd03e6da37080e5c3fff","user":{"login":"brthor","id":14280892,"avatar_url":"https://avatars.githubusercontent.com/u/14280892?v=3","gravatar_id":"","url":"https://api.github.com/users/brthor","html_url":"https://github.com/brthor","followers_url":"https://api.github.com/users/brthor/followers","following_url":"https://api.github.com/users/brthor/following{/other_user}","gists_url":"https://api.github.com/users/brthor/gists{/gist_id}","starred_url":"https://api.github.com/users/brthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brthor/subscriptions","organizations_url":"https://api.github.com/users/brthor/orgs","repos_url":"https://api.github.com/users/brthor/repos","events_url":"https://api.github.com/users/brthor/events{/privacy}","received_events_url":"https://api.github.com/users/brthor/received_events","type":"User","site_admin":false},"repo":{"id":59325896,"name":"core-setup","full_name":"brthor/core-setup","owner":{"login":"brthor","id":14280892,"avatar_url":"https://avatars.githubusercontent.com/u/14280892?v=3","gravatar_id":"","url":"https://api.github.com/users/brthor","html_url":"https://github.com/brthor","followers_url":"https://api.github.com/users/brthor/followers","following_url":"https://api.github.com/users/brthor/following{/other_user}","gists_url":"https://api.github.com/users/brthor/gists{/gist_id}","starred_url":"https://api.github.com/users/brthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brthor/subscriptions","organizations_url":"https://api.github.com/users/brthor/orgs","repos_url":"https://api.github.com/users/brthor/repos","events_url":"https://api.github.com/users/brthor/events{/privacy}","received_events_url":"https://api.github.com/users/brthor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brthor/core-setup","description":"","fork":true,"url":"https://api.github.com/repos/brthor/core-setup","forks_url":"https://api.github.com/repos/brthor/core-setup/forks","keys_url":"https://api.github.com/repos/brthor/core-setup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brthor/core-setup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brthor/core-setup/teams","hooks_url":"https://api.github.com/repos/brthor/core-setup/hooks","issue_events_url":"https://api.github.com/repos/brthor/core-setup/issues/events{/number}","events_url":"https://api.github.com/repos/brthor/core-setup/events","assignees_url":"https://api.github.com/repos/brthor/core-setup/assignees{/user}","branches_url":"https://api.github.com/repos/brthor/core-setup/branches{/branch}","tags_url":"https://api.github.com/repos/brthor/core-setup/tags","blobs_url":"https://api.github.com/repos/brthor/core-setup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brthor/core-setup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brthor/core-setup/git/refs{/sha}","trees_url":"https://api.github.com/repos/brthor/core-setup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brthor/core-setup/statuses/{sha}","languages_url":"https://api.github.com/repos/brthor/core-setup/languages","stargazers_url":"https://api.github.com/repos/brthor/core-setup/stargazers","contributors_url":"https://api.github.com/repos/brthor/core-setup/contributors","subscribers_url":"https://api.github.com/repos/brthor/core-setup/subscribers","subscription_url":"https://api.github.com/repos/brthor/core-setup/subscription","commits_url":"https://api.github.com/repos/brthor/core-setup/commits{/sha}","git_commits_url":"https://api.github.com/repos/brthor/core-setup/git/commits{/sha}","comments_url":"https://api.github.com/repos/brthor/core-setup/comments{/number}","issue_comment_url":"https://api.github.com/repos/brthor/core-setup/issues/comments{/number}","contents_url":"https://api.github.com/repos/brthor/core-setup/contents/{+path}","compare_url":"https://api.github.com/repos/brthor/core-setup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brthor/core-setup/merges","archive_url":"https://api.github.com/repos/brthor/core-setup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brthor/core-setup/downloads","issues_url":"https://api.github.com/repos/brthor/core-setup/issues{/number}","pulls_url":"https://api.github.com/repos/brthor/core-setup/pulls{/number}","milestones_url":"https://api.github.com/repos/brthor/core-setup/milestones{/number}","notifications_url":"https://api.github.com/repos/brthor/core-setup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brthor/core-setup/labels{/name}","releases_url":"https://api.github.com/repos/brthor/core-setup/releases{/id}","deployments_url":"https://api.github.com/repos/brthor/core-setup/deployments","created_at":"2016-05-20T20:56:37Z","updated_at":"2016-06-01T22:23:26Z","pushed_at":"2016-06-08T21:38:43Z","git_url":"git://github.com/brthor/core-setup.git","ssh_url":"git@github.com:brthor/core-setup.git","clone_url":"https://github.com/brthor/core-setup.git","svn_url":"https://github.com/brthor/core-setup","homepage":null,"size":805,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:release/1.0.0","ref":"release/1.0.0","sha":"f3bd42499893eb504f1e315ee827c75a264a6b67","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":59249196,"name":"core-setup","full_name":"dotnet/core-setup","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/core-setup","description":"Installer packages for the .NET Core runtime and libraries","fork":false,"url":"https://api.github.com/repos/dotnet/core-setup","forks_url":"https://api.github.com/repos/dotnet/core-setup/forks","keys_url":"https://api.github.com/repos/dotnet/core-setup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/core-setup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/core-setup/teams","hooks_url":"https://api.github.com/repos/dotnet/core-setup/hooks","issue_events_url":"https://api.github.com/repos/dotnet/core-setup/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/core-setup/events","assignees_url":"https://api.github.com/repos/dotnet/core-setup/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/core-setup/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/core-setup/tags","blobs_url":"https://api.github.com/repos/dotnet/core-setup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/core-setup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/core-setup/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/core-setup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/core-setup/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/core-setup/languages","stargazers_url":"https://api.github.com/repos/dotnet/core-setup/stargazers","contributors_url":"https://api.github.com/repos/dotnet/core-setup/contributors","subscribers_url":"https://api.github.com/repos/dotnet/core-setup/subscribers","subscription_url":"https://api.github.com/repos/dotnet/core-setup/subscription","commits_url":"https://api.github.com/repos/dotnet/core-setup/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/core-setup/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/core-setup/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/core-setup/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/core-setup/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/core-setup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/core-setup/merges","archive_url":"https://api.github.com/repos/dotnet/core-setup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/core-setup/downloads","issues_url":"https://api.github.com/repos/dotnet/core-setup/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/core-setup/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/core-setup/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/core-setup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/core-setup/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/core-setup/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/core-setup/deployments","created_at":"2016-05-19T23:07:13Z","updated_at":"2016-06-02T05:08:01Z","pushed_at":"2016-06-08T21:38:44Z","git_url":"git://github.com/dotnet/core-setup.git","ssh_url":"git@github.com:dotnet/core-setup.git","clone_url":"https://github.com/dotnet/core-setup.git","svn_url":"https://github.com/dotnet/core-setup","homepage":"","size":886,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":21,"forks":17,"open_issues":21,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/core-setup/pulls/97"},"html":{"href":"https://github.com/dotnet/core-setup/pull/97"},"issue":{"href":"https://api.github.com/repos/dotnet/core-setup/issues/97"},"comments":{"href":"https://api.github.com/repos/dotnet/core-setup/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/core-setup/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/core-setup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/core-setup/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/core-setup/statuses/1ff3dff21c8eb43dadeafd03e6da37080e5c3fff"}}}}
{"actor":{"display_login":"brthor"}}