dotnet-installer/test
Peter Huene b1f8eb1d8d
Fix crash when user home directory cannot be determined.
Currently, dotnet will crash with an `ArgumentNullException` if `USERPROFILE`
(Windows) or `HOME` (macOS and Linux) is not set in the environment.  This
is because there is a missing null check after retrieving the environment
variable's value.  Additionally, if either variable is set to an empty string,
a `.dotnet` directory is created in the current directory where dotnet is being
run.

This commit fixes this by printing a graceful error informing the user the home
directory could not be determined and to set `DOTNET_CLI_HOME` to the directory
to use.  This variable will be respected before `USERPROFILE` or `HOME`. It is
likely that CI environments where `HOME` is not set can use `DOTNET_CLI_HOME`
to specify a local temporary location; by using this variable rather than
setting `HOME`, it is guaranteed to only affect dotnet.

It was discussed that we should perhaps fallback to some temporary location if
the home directory could not be determined, but NuGet currently requires `HOME`
to be set to work.  Because of this, it was decided that we should just handle
this case gracefully and provide a way for users to override the home directory
without relying on `USERPROFILE`/`HOME` entirely.

Closes #8053.
2018-05-22 17:34:39 -07:00
..
ArgumentForwardingTests Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
ArgumentsReflector Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
binding-redirects.Tests Removing the Additional restore source for the binding redirect test project. It has no package dependency on a CLI produced package. 2018-05-17 15:04:40 -07:00
crossgen.Tests Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
dotnet-add-package.Tests Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
dotnet-add-reference.Tests Improve command line help user experience. 2018-05-18 16:43:31 -07:00
dotnet-back-compat.Tests Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
dotnet-build.Tests Adds Microsoft.Docker.Sdk to CLI 2018-01-17 11:12:19 -08:00
dotnet-clean.Tests Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
dotnet-help.Tests Improve command line help user experience. 2018-05-18 16:43:31 -07:00
dotnet-install-tool.Tests Change command order for tools (#8862) 2018-03-21 19:12:32 -07:00
dotnet-list-reference.Tests Improve command line help user experience. 2018-05-18 16:43:31 -07:00
dotnet-migrate.Tests Fix project type GUIDs when adding projects to solution files. 2018-03-22 21:32:39 -07:00
dotnet-msbuild.Tests Fix MSBuild invocation to quote property option values. 2018-04-26 14:38:21 -07:00
dotnet-new.Tests Re-activate templating test. 2018-03-12 13:16:45 -07:00
dotnet-nuget.UnitTests Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
dotnet-pack.Tests Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
dotnet-publish.Tests Revert "Adding a work around for publishing self-contained apps to RIDs that are not available for Microsoft.NETCore.App 2.0.0." 2018-05-03 15:50:19 -07:00
dotnet-remove-package.Tests Improve command line help user experience. 2018-05-18 16:43:31 -07:00
dotnet-remove-reference.Tests Improve command line help user experience. 2018-05-18 16:43:31 -07:00
dotnet-restore.Tests Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
dotnet-run.Tests Try shorter test names 2018-03-23 10:30:47 -07:00
dotnet-sln-add.Tests Improve command line help user experience. 2018-05-18 16:43:31 -07:00
dotnet-sln-list.Tests Improve command line help user experience. 2018-05-18 16:43:31 -07:00
dotnet-sln-remove.Tests Improve command line help user experience. 2018-05-18 16:43:31 -07:00
dotnet-store.Tests Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
dotnet-test.Tests Multiple Logger/TestAdapter inputs from dotnet CLI 2018-05-17 12:54:39 +05:30
dotnet-vstest.Tests Merge remote-tracking branch 'dotnet/release/2.0.0' into merges/release/2.0.0-to-release/2.1-20180103-080038 2018-01-03 16:16:41 -08:00
dotnet.Tests Fix crash when user home directory cannot be determined. 2018-05-22 17:34:39 -07:00
EndToEnd Fixing CI build breaks for new CI legs; CLI:release/2.1.3xx (#9202) 2018-05-08 10:05:21 -07:00
InsertionTests bundled DotnetTool (#8606) 2018-02-16 13:32:29 -08:00
Installer Move some projects to netstandard2.0 (#8692) 2018-03-22 16:11:51 -07:00
Microsoft.DotNet.Cli.Sln.Internal.Tests Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
Microsoft.DotNet.Cli.Utils.Tests Add TryGetMostFitRuntimeIdentifier (#8997) 2018-04-06 17:39:58 -07:00
Microsoft.DotNet.Configurer.UnitTests Make CliFolderPathCalculator a static class. 2018-05-22 17:34:39 -07:00
Microsoft.DotNet.MSBuildSdkResolver.Tests Override new SdkResult public properties 2018-05-21 15:29:38 -07:00
Microsoft.DotNet.ShellShim.Tests consume bring your own shim(byos) (#9018) 2018-04-10 15:42:50 -07:00
Microsoft.DotNet.TestFramework Removing direct dependency to NetStandard.Library From TestFramework. 2018-05-11 09:57:00 -07:00
Microsoft.DotNet.ToolPackage.Tests Fix --source-feed option for tool install and update commands. 2018-04-24 20:43:14 -07:00
Microsoft.DotNet.Tools.Tests.ComponentMocks do not set BaseIntermediateOutputPath in temp project of dotnet install (#9122) 2018-04-24 10:19:27 -07:00
Microsoft.DotNet.Tools.Tests.Utilities Merge remote-tracking branch 'dotnet/release/2.1.2xx' into merges/release/2.1.2xx-to-release/2.1.3xx 2018-05-03 15:24:39 -07:00
msbuild.IntegrationTests Make the default verbosity for dotnet clean normal. This way we can get some meaningful output out of the command. 2018-03-01 14:09:06 -08:00
Msbuild.Tests.Utilities Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040 2017-12-07 09:55:12 -08:00
MsBuildScript.Tests Fixing the URLs for the msbuildscript.tests to use the new asp.net runtime folder as well. 2018-02-15 12:58:21 -08:00
Directory.Build.props Support new artifacts layout in tests and other build logic 2017-08-24 15:49:13 -07:00
Microsoft.DotNet.Cli.Tests.sln bundled DotnetTool (#8606) 2018-02-16 13:32:29 -08:00