Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,7 @@ public async Task<int> OrchestrateTestHostExecutionAsync(CancellationToken cance
fileSystem.CreateDirectory(Path.GetDirectoryName(finalFileLocation)!);

await outputDevice.DisplayAsync(this, new TextOutputDeviceData(string.Format(CultureInfo.InvariantCulture, ExtensionResources.MovingFileToLocation, file, finalFileLocation)), cancellationToken).ConfigureAwait(false);
#if NETCOREAPP
fileSystem.MoveFile(file, finalFileLocation, overwrite: true);
#else
fileSystem.CopyFile(file, finalFileLocation, overwrite: true);
fileSystem.DeleteFile(file);
#endif
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,5 @@ internal interface IFileSystem

Task<string> ReadAllTextAsync(string path);

void CopyFile(string sourceFileName, string destFileName, bool overwrite = false);

void DeleteFile(string path);
Comment on lines -24 to -26
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a binary breaking change. It's fine to simplify the RetryOrchestrator, but we shouldn't remove these members from the interface, at least for few minor versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add a comment explicitly stating that while these are unused, they are needed so that older versions of Retry can remain compatible with newer versions of MTP.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my understanding is that all nugets are deployed at the same time. given that they must have a min version on the core. so it should be safe to remove internal APIs. unless there are external projects that use internals and are deployed in an out of sync way?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We deploy at the same time, and we have min version. But given that the version constraint is "min" and not "strictly equal", this is problematic.

Consider:

  1. Project uses MSTest 4.1 (bringing MTP 2.1)
  2. Project uses Retry 2.1
  3. Project uses TRX 2.1

Then after our next release, if the user updated TRX to 2.2. They will hit an issue.
The Retry version being used is 2.1, while the core MTP used is 2.2 (brought via TRX). Retry 2.1 will attempt to access CopyFile/DeleteFile, but these will not be present at runtime in 2.2.


string[] GetFiles(string path, string searchPattern, SearchOption searchOption);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ internal sealed class SystemFileSystem : IFileSystem

public Task<string> ReadAllTextAsync(string path) => File.ReadAllTextAsync(path);

public void CopyFile(string sourceFileName, string destFileName, bool overwrite = false) => File.Copy(sourceFileName, destFileName, overwrite);

public void DeleteFile(string path) => File.Delete(path);

public bool ExistDirectory(string? path) => Directory.Exists(path);

public string[] GetFiles(string path, string searchPattern, SearchOption searchOption) => Directory.GetFiles(path, searchPattern, searchOption);
Expand Down
Loading