-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove test setup that's happening in the CI setup scripts
The tests that need to set things up like this should just be ensuring this state directly, since there's no guarantee that this would have ran before many types of tests run. Fixes #49486
- Loading branch information
1 parent
05e716a
commit c5b1c4c
Showing
12 changed files
with
101 additions
and
141 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,74 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.IO; | ||
using System.Threading; | ||
|
||
namespace Microsoft.CodeAnalysis.UnitTests | ||
{ | ||
internal static class ProjectGuardFiles | ||
{ | ||
private static int _alreadyWritten = 0; | ||
|
||
internal static void EnsureWrittenToTemp() | ||
{ | ||
if (Interlocked.CompareExchange(ref _alreadyWritten, value: 1, comparand: 0) != 0) | ||
return; | ||
|
||
File.WriteAllText(Path.Combine(Path.GetTempPath(), "global.json"), | ||
""" | ||
{ | ||
"comment": "this file is empty to ensure we get the 'standard' behavior as if no global.json was specified in the first place" | ||
} | ||
"""); | ||
|
||
File.WriteAllText(Path.Combine(Path.GetTempPath(), "Directory.Build.props"), | ||
""" | ||
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> | ||
<Project> | ||
<PropertyGroup> | ||
<!-- Attempt to make our test more deterministic by disabling any overrides that could be | ||
accidentally installed on the developers machine | ||
--> | ||
<ImportUserLocationsByWildcardBeforeMicrosoftCommonProps>false</ImportUserLocationsByWildcardBeforeMicrosoftCommonProps> | ||
<ImportUserLocationsByWildcardAfterMicrosoftCommonProps>false</ImportUserLocationsByWildcardAfterMicrosoftCommonProps> | ||
<ImportUserLocationsByWildcardBeforeMicrosoftCSharpTargets>false</ImportUserLocationsByWildcardBeforeMicrosoftCSharpTargets> | ||
<ImportUserLocationsByWildcardAfterMicrosoftCSharpTargets>false</ImportUserLocationsByWildcardAfterMicrosoftCSharpTargets> | ||
<ImportUserLocationsByWildcardBeforeMicrosoftNetFrameworkProps>false</ImportUserLocationsByWildcardBeforeMicrosoftNetFrameworkProps> | ||
<ImportUserLocationsByWildcardAfterMicrosoftNetFrameworkProps>false</ImportUserLocationsByWildcardAfterMicrosoftNetFrameworkProps> | ||
</PropertyGroup> | ||
</Project> | ||
"""); | ||
|
||
File.WriteAllText(Path.Combine(Path.GetTempPath(), "Directory.Build.rsp"), | ||
""" | ||
# This file intentionally left blank to avoid accidental import during testing | ||
"""); | ||
|
||
File.WriteAllText(Path.Combine(Path.GetTempPath(), "Directory.Build.targets"), | ||
""" | ||
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> | ||
<Project> | ||
<!-- Intentionally left blank. This file is used to prevent accidental import of | ||
Directory.Build.props from our repo during testing --> | ||
</Project> | ||
"""); | ||
|
||
File.WriteAllText(Path.Combine(Path.GetTempPath(), "NuGet.Config"), | ||
""" | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<!-- Provide a default package restore source for test projects. --> | ||
<packageRestore> | ||
<add key="enabled" value="true" /> | ||
</packageRestore> | ||
<packageSources> | ||
<clear /> | ||
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" /> | ||
</packageSources> | ||
</configuration> | ||
"""); | ||
} | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
src/Workspaces/MSBuild/Test/Resources/Directory.Build.props
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
src/Workspaces/MSBuild/Test/Resources/Directory.Build.targets
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.