Skip to content

Commit

Permalink
Revert "Use helix reporting (#7383)"
Browse files Browse the repository at this point in the history
This reverts commit 7f52af2.
  • Loading branch information
missymessa committed Jul 7, 2021
1 parent 55eff33 commit 73c9e8e
Show file tree
Hide file tree
Showing 16 changed files with 612 additions and 108 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,3 @@ node_modules/
# Python Compile Outputs

*.pyc

# IntelliJ
.idea/

# vscode python env files
.env
5 changes: 0 additions & 5 deletions eng/test-configuration.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.IO;
using Xunit;
using System.Net;
using Newtonsoft.Json;

namespace Microsoft.DotNet.Helix.Sdk.Tests
{
Expand Down Expand Up @@ -38,18 +35,5 @@ public void VerifyNonEncodedFowardSlashIsConverted()

Assert.Equal(workItemNameExpected, actual);
}

[Fact]
public void FailOnceThenPass()
{
var target = Path.Combine(Path.GetTempPath(), "my-test-file-123456.snt");
bool exists = File.Exists(target);
if (!exists)
{
File.WriteAllText(target, "Test failed once");
}

Assert.True(exists, $"File should exist: {target}");
}
}
}
35 changes: 4 additions & 31 deletions src/Microsoft.DotNet.Helix/Sdk/SendHelixJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading;
Expand Down Expand Up @@ -34,7 +33,6 @@ public static class MetadataNames
public const string Uri = "Uri";
public const string Destination = "Destination";
public const string IncludeDirectoryName = "IncludeDirectoryName";
public const string AsArchive = "AsArchive";
}

/// <summary>
Expand Down Expand Up @@ -523,41 +521,16 @@ private IJobDefinition AddCorrelationPayload(IJobDefinition def, ITaskItem corre
if (Directory.Exists(path))
{
string includeDirectoryNameStr = correlationPayload.GetMetadata(MetadataNames.IncludeDirectoryName);
if (!bool.TryParse(includeDirectoryNameStr, out bool includeDirectoryName))
{
includeDirectoryName = false;
}
bool.TryParse(includeDirectoryNameStr, out bool includeDirectoryName);

Log.LogMessage(
MessageImportance.Low,
$"Adding Correlation Payload Directory '{path}', destination '{destination}'"
);
Log.LogMessage(MessageImportance.Low, $"Adding Correlation Payload Directory '{path}', destination '{destination}'");
return def.WithCorrelationPayloadDirectory(path, includeDirectoryName, destination);

}

if (File.Exists(path))
{
string asArchiveStr = correlationPayload.GetMetadata(MetadataNames.AsArchive);
if (!bool.TryParse(asArchiveStr, out bool asArchive))
{
asArchive = false;
}

if (asArchive)
{
Log.LogMessage(
MessageImportance.Low,
$"Adding Correlation Payload Archive '{path}', destination '{destination}'"
);
return def.WithCorrelationPayloadArchive(path, destination);
}

Log.LogMessage(
MessageImportance.Low,
$"Adding Correlation Payload File '{path}', destination '{destination}'"
);
return def.WithCorrelationPayloadFiles(path);
Log.LogMessage(MessageImportance.Low, $"Adding Correlation Payload Archive '{path}', destination '{destination}'");
return def.WithCorrelationPayloadArchive(path, destination);
}

Log.LogError(FailureCategory.Build, $"Correlation Payload '{path}' not found.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
<PropertyGroup>
<EnableXUnitReporter Condition=" '$(EnableXUnitReporter)' != 'true' ">false</EnableXUnitReporter>
</PropertyGroup>

<PropertyGroup Condition=" '$(HelixTestConfigurationFilePath)' == '' ">
<HelixTestConfigurationFilePath Condition=" '$(RepositoryEngineeringDir)' != '' ">$(RepositoryEngineeringDir)/test-configuration.json</HelixTestConfigurationFilePath>
</PropertyGroup>


<Choose>
<When Condition="$(HelixTargetQueue.ToLowerInvariant().Contains('windows'))">
<PropertyGroup>
Expand Down Expand Up @@ -40,10 +36,6 @@
<HelixProperties Condition="'$(HelixArchitecture)' != ''" Include="architecture" Value="$(HelixArchitecture)" />
<HelixProperties Include="operatingSystem" Value="$(HelixTargetQueue)" />
</ItemGroup>

<ItemGroup Condition="Exists('$(HelixTestConfigurationFilePath)')">
<HelixCorrelationPayload Include="$(HelixTestConfigurationFilePath)" AsArchive="false" />
</ItemGroup>

<Target Name="CoreBuild">
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<PropertyGroup>
<HelixPostCommands Condition="$(IsPosixShell)">
$(HelixPostCommands);
$HELIX_PYTHONPATH $HELIX_CORRELATION_PAYLOAD/reporter/run.py $(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI) $(SYSTEM_TEAMPROJECT) $(TestRunId) $(SYSTEM_ACCESSTOKEN) || exit $?
/bin/sh $HELIX_CORRELATION_PAYLOAD/reporter/run.sh $(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI) $(SYSTEM_TEAMPROJECT) $(TestRunId) $(SYSTEM_ACCESSTOKEN) || exit $?
</HelixPostCommands>
<HelixPostCommands Condition="!$(IsPosixShell)">
$(HelixPostCommands);
%HELIX_PYTHONPATH% %HELIX_CORRELATION_PAYLOAD%\reporter\run.py $(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI) $(SYSTEM_TEAMPROJECT) $(TestRunId) $(SYSTEM_ACCESSTOKEN) || exit /b
call %HELIX_CORRELATION_PAYLOAD%\reporter\run.bat $(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI) $(SYSTEM_TEAMPROJECT) $(TestRunId) $(SYSTEM_ACCESSTOKEN) || exit /b
</HelixPostCommands>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 73c9e8e

Please sign in to comment.