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

[Test] #20822

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

[Test] #20822

Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 50 additions & 0 deletions BuildConfigGen/EnsureUpdateModeVerifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Diagnostics;
using System.IO;
using System.Security.AccessControl;
using System.Text;

namespace BuildConfigGen
{
Expand Down Expand Up @@ -105,12 +106,61 @@ public IEnumerable<string> GetVerifyErrors(bool skipContentCheck)
}

contentError = $"Content doesn't match {r.Value} {procesed}to {r.Key} (overwrite=true). Dest file doesn't match source.";


// Write the content of the mismatched files to the console
Console.WriteLine($"Mismatched Source File ({sourceFile}):");
Console.WriteLine(File.ReadAllText(sourceFile));
Console.WriteLine($"Mismatched Destination File ({r.Key}):");
Console.WriteLine(File.ReadAllText(r.Key));

// Output the result of 'git status'
var gitStatus = Run("git", "status");
Console.WriteLine("Git Status:");
Console.WriteLine(gitStatus);

var commit = Run("git", "rev-parse HEAD");
Console.WriteLine("rev-parse HEAD:");
Console.WriteLine(commit);

var show = Run("git", "show HEAD");
Console.WriteLine("show HEAD:");
Console.WriteLine(show);
}
}

return contentError;
}

private string Run(string filename, string args)
{
var psi = new ProcessStartInfo
{
FileName = filename,
Arguments = args,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true
};

var output = new StringBuilder();
var error = new StringBuilder();

using (var process = new Process { StartInfo = psi })
{
process.OutputDataReceived += (sender, e) => { if (e.Data != null) output.AppendLine(e.Data); };
process.ErrorDataReceived += (sender, e) => { if (e.Data != null) error.AppendLine(e.Data); };

process.Start();
process.BeginOutputReadLine();
process.BeginErrorReadLine();
process.WaitForExit();
}

return output.ToString() + error.ToString();
}

public void CleanupTempFiles()
{
try
Expand Down
358 changes: 261 additions & 97 deletions Tasks/AppCenterDistributeV3/Tests/package-lock.json

Large diffs are not rendered by default.

Loading