Skip to content
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

Update from 16.8 #2588

Merged
merged 28 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
47fee27
Hide -release in console
nohwnd Jun 5, 2020
9ed42e4
Add param block
nohwnd Jun 8, 2020
6de7aca
Match on whole branch name
nohwnd Jun 8, 2020
b60cf6f
Set var
nohwnd Jun 8, 2020
1fbf4a3
Change assertion
nohwnd Jun 8, 2020
501939e
Trim version
nohwnd Jun 8, 2020
fceebbc
Update dependencies from https://github.com/dotnet/arcade build 20200…
dotnet-maestro[bot] Jun 9, 2020
c449a1e
Update feeds
nohwnd Jun 9, 2020
f777f36
Merge master
nohwnd Jun 9, 2020
2474ad2
Revert to previous dotnet version
nohwnd Jun 9, 2020
df62aca
Added new exception handling (#2461)
Sanan07 Jun 12, 2020
c1b6b2c
Adding test run attachments processing (#2463)
jakubch1 Jul 2, 2020
4ec9fb2
Add environment variables to enable MacOS dump
nohwnd Aug 11, 2020
1d30394
Fixed code coverage compatibility issue (#2527)
cvpoienaru Aug 19, 2020
fd2748b
Forward merge master
nohwnd Aug 21, 2020
f5e870b
Print only whole version on release branch.
nohwnd Aug 21, 2020
c1a6782
Print version of the product in log (#2535)
nohwnd Aug 25, 2020
3454261
Trigger dumps asynchronously (#2533)
nohwnd Aug 26, 2020
088da43
Revert "Trigger dumps asynchronously (#2533)" (#2541)
nohwnd Aug 26, 2020
42b3463
Remove env variables
nohwnd Aug 28, 2020
4fcacb2
Merge branch 'rel/16.8' of https://github.com/microsoft/vstest into r…
nohwnd Aug 28, 2020
b9cd8eb
Remove sleeps and extra process dumps from blame
nohwnd Sep 1, 2020
0c0fafa
Merge branch 'master' of https://github.com/microsoft/vstest into rel…
nohwnd Sep 2, 2020
70a599d
Fix blame parameter, warning, and add all testhosts to be ngend (#2579)
nohwnd Sep 18, 2020
2418d9e
Forward merge fixes from master to rc2 (#2581)
nohwnd Sep 24, 2020
2e615ad
Generate release notes in pipeline
nohwnd Sep 25, 2020
7f76811
Merge branch 'rel/16.8' into update-from-16.8
nohwnd Oct 5, 2020
e6a7209
Fix release-notes-script
nohwnd Oct 5, 2020
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
119 changes: 119 additions & 0 deletions scripts/write-release-notes.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
[CmdletBinding()]
param
(
[string] $Path = ".",
# if this is a pre-release or stable version
[switch] $Stable,
# externally provide the version number we will use
[string] $PackageVersion,
# in CI we don't know the end tag, so we diff till the current commit
[switch] $EndWithLatestCommit
)

if ($EndWithLatestCommit -and [string]::IsNullOrWhiteSpace($PackageVersion)) {
throw "EndWithLatestCommit was enabled, provide PackageVersion in this format 16.8.0-preview-20200924-01, or this format 16.8.0."
}

$repoUrl = $(if ((git -C $Path remote -v) -match "upstream") {
git -C $Path remote get-url --push upstream
}
else {
git -C $Path remote get-url --push origin
})-replace "\.git$"

# list all tags on this branch ordered by creator date to get the latest, stable or pre-release tag.
# For stable release we choose only tags without any dash, for pre-release we choose all tags.
$tags = git -C $Path tag -l --sort=creatordate | Where-Object { $_ -match "v\d+\.\d+\.\d+.*" -and (-not $Stable -or $_ -notlike '*-*') }

if ($EndWithLatestCommit) {
# in CI we don't have the tag yet, so we show changes between the most recent tag, and this commit
# we figure out the tag from the package version that is set by vsts-prebuild
$start = $tags | Select-Object -Last 1
$end = git -C $Path rev-parse HEAD
$tag = "v$PackageVersion"
}
else {
# normally we show changes between the latest two tags
$start, $end = $tags | Select-Object -Last 2
$tag = $end
}

# # override the tags to use if you need
# $start = "v16.8.0-preview-20200812-03"
# $end = $tag = "v16.8.0-preview-20200921-01"


Write-Host "Generating release notes for $start..$end$(if ($EndWithLatestCommit) { " (expected tag: $tag)" })"

$sourceBranch = $branch = git -C $Path rev-parse --abbrev-ref HEAD
if ($sourceBranch -eq "HEAD") {
# when CI checks out just the single commit, https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
$sourceBranch = $env:BUILD_SOURCEBRANCH -replace "^refs/heads/"
}

if ([string]::IsNullOrWhiteSpace($branch)) {
throw "Branch is null or empty!"
}

if ([string]::IsNullOrWhiteSpace($sourceBranch)) {
throw "SourceBranch is null or empty!"
}

Write-Host "Branch is $branch"
Write-Host "SourceBranch is $sourceBranch"
$branchesWithStartTag = git -C $Path branch --contains tags/$start

if (-not $branchesWithStartTag -or -not ($branchesWithStartTag -match $branch)) {
Write-Host "This branch $branch$(if($branch -ne $sourceBranch){" ($sourceBranch)"}), does not contain the starting tag $start. Skipping generating release notes."
if ($branchesWithStartTag) {
Write-Host "The tag is present on branches:`n$($branchesWithStartTag)."
}
return
}
else {
Write-Host "Branch $branch$(if($branch -ne $sourceBranch){" ($sourceBranch)"}) has tag $start, getting log since that."
}

$prUrl = "$repoUrl/pull/"
$v = $tag -replace '^v'
$b = if ($Stable) { $v } else { $tag -replace '.*?(\d+-\d+)$', '$1' }
# using .. because I want to know the changes that are on this branch, but don't care about the changes that I don't have https://stackoverflow.com/a/24186641/3065397
$log = (git -C $Path log "$start..$end" --oneline --pretty="format:%s" --first-parent)
$issues = $log | ForEach-Object {
if ($_ -match '^(?<message>.+)\s\(#(?<pr>\d+)\)?$') {
$message = "* $($matches.message)"
if ($matches.pr) {
$pr = $matches.pr
$message += " [#$pr]($prUrl$pr)"
}

$message
}
else
{
"* $_"
}
}

$output = @"

See the release notes [here](https://github.com/microsoft/vstest-docs/blob/master/docs/releases.md#$($v -replace '\.')).

-------------------------------

## $v

### Issue Fixed
$($issues -join "`n")

See full log [here]($repoUrl/compare/$start...$tag)

### Drops

* TestPlatform vsix: [$v](https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/microsoft/vstest/$sourceBranch/$b;/TestPlatform.vsix)
* Microsoft.TestPlatform.ObjectModel : [$v](https://www.nuget.org/packages/Microsoft.TestPlatform.ObjectModel/$v)
"@


$output
$output | clip
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ private void ValidateAndAddHangBasedProcessDumpParameters(XmlElement collectDump

break;

// allow HangDumpType attribute to be used on the hang dump this is the prefered way
case XmlAttribute attribute when string.Equals(attribute.Name, Constants.HangDumpTypeKey, StringComparison.OrdinalIgnoreCase):

if (string.Equals(attribute.Value, Constants.FullConfigurationValue, StringComparison.OrdinalIgnoreCase) || string.Equals(attribute.Value, Constants.MiniConfigurationValue, StringComparison.OrdinalIgnoreCase))
Expand All @@ -361,6 +362,20 @@ private void ValidateAndAddHangBasedProcessDumpParameters(XmlElement collectDump

break;

// allow DumpType attribute to be used on the hang dump for backwards compatibility
case XmlAttribute attribute when string.Equals(attribute.Name, Constants.DumpTypeKey, StringComparison.OrdinalIgnoreCase):

if (string.Equals(attribute.Value, Constants.FullConfigurationValue, StringComparison.OrdinalIgnoreCase) || string.Equals(attribute.Value, Constants.MiniConfigurationValue, StringComparison.OrdinalIgnoreCase))
{
this.processFullDumpEnabled = string.Equals(attribute.Value, Constants.FullConfigurationValue, StringComparison.OrdinalIgnoreCase);
}
else
{
this.logger.LogWarning(this.context.SessionDataCollectionContext, string.Format(CultureInfo.CurrentUICulture, Resources.Resources.BlameParameterValueIncorrect, attribute.Name, Constants.FullConfigurationValue, Constants.MiniConfigurationValue));
}

break;

default:

this.logger.LogWarning(this.context.SessionDataCollectionContext, string.Format(CultureInfo.CurrentUICulture, Resources.Resources.BlameParameterKeyIncorrect, blameAttribute.Name));
Expand Down Expand Up @@ -454,7 +469,7 @@ private void SessionEndedHandler(object sender, SessionEndEventArgs args)
{
try
{
var dumpFiles = this.processDumpUtility.GetDumpFiles();
var dumpFiles = this.processDumpUtility.GetDumpFiles(warnOnNoDumpFiles: this.collectDumpAlways);
foreach (var dumpFile in dumpFiles)
{
if (!string.IsNullOrEmpty(dumpFile))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ public interface IProcessDumpUtility
/// <summary>
/// Get generated dump files
/// </summary>
/// <param name="warnOnNoDumpFiles">Writes warning when no dump file is found.</param>
/// <returns>
/// Path of dump file
/// </returns>
IEnumerable<string> GetDumpFiles();
IEnumerable<string> GetDumpFiles(bool warnOnNoDumpFiles = true);

/// <summary>
/// Launch proc dump process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ProcessDumpUtility(IProcessHelper processHelper, IFileHelper fileHelper,
};

/// <inheritdoc/>
public IEnumerable<string> GetDumpFiles()
public IEnumerable<string> GetDumpFiles(bool warnOnNoDumpFiles = true)
{
if (!this.wasHangDumped)
{
Expand Down Expand Up @@ -82,7 +82,7 @@ public IEnumerable<string> GetDumpFiles()
}
}

if (!foundDumps.Any())
if (warnOnNoDumpFiles && !foundDumps.Any())
{
EqtTrace.Error($"ProcessDumpUtility.GetDumpFile: Could not find any dump file in {this.hangDumpDirectory}.");
throw new FileNotFoundException(Resources.Resources.DumpFileNotGeneratedErrorMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public WindowsHangDumper(Action<string> logWarning)
public void Dump(int processId, string outputDirectory, DumpTypeOption type)
{
var process = Process.GetProcessById(processId);
var processTree = process.GetProcessTree();
var processTree = process.GetProcessTree().Where(p => p.Process.ProcessName != "conhost" && p.Process.ProcessName != "WerFault").ToList();

if (processTree.Count > 1)
{
Expand Down
16 changes: 16 additions & 0 deletions src/package/VSIXProject/TestPlatform.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,22 @@

<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.exe" Ngen="true" NgenArchitecture="X64" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.x86.exe" Ngen="true" NgenArchitecture="X86" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.x86.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net452.exe" Ngen="true" NgenArchitecture="X64" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net452.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net452.x86.exe" Ngen="true" NgenArchitecture="X86" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net452.x86.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net46.exe" Ngen="true" NgenArchitecture="X64" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net46.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net46.x86.exe" Ngen="true" NgenArchitecture="X86" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net46.x86.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net461.exe" Ngen="true" NgenArchitecture="X64" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net461.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net461.x86.exe" Ngen="true" NgenArchitecture="X86" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net461.x86.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net462.exe" Ngen="true" NgenArchitecture="X64" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net462.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net462.x86.exe" Ngen="true" NgenArchitecture="X86" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net462.x86.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net47.exe" Ngen="true" NgenArchitecture="X64" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net47.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net47.x86.exe" Ngen="true" NgenArchitecture="X86" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net47.x86.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net471.exe" Ngen="true" NgenArchitecture="X64" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net471.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net471.x86.exe" Ngen="true" NgenArchitecture="X86" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net471.x86.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net472.exe" Ngen="true" NgenArchitecture="X64" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net472.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net472.x86.exe" Ngen="true" NgenArchitecture="X86" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net472.x86.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net48.exe" Ngen="true" NgenArchitecture="X64" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net48.exe" />
<VsixSourceItem Update="$(VsixInputFileLocation)\testhost.net48.x86.exe" Ngen="true" NgenArchitecture="X86" NgenPriority="2" NgenApplication="$(ExtensionInstallationRelativeToVS)\testhost.net48.x86.exe" />
</ItemGroup>
<ItemGroup>
<Content Include="License.rtf">
Expand Down
Loading