Skip to content

Commit

Permalink
Merge pull request #63 from microsoft/fixFlightSubmission
Browse files Browse the repository at this point in the history
Added missing FlightPackageUpdate.Id.
  • Loading branch information
azchohfi authored Aug 16, 2024
2 parents 186dcba + e5b4eca commit fa756b8
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions MSStore.API/Packaged/Models/FlightPackageUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace MSStore.API.Packaged.Models
{
public class FlightPackageUpdate
{
public string? Id { get; set; }
public string? FileName { get; set; }
public FileStatus? FileStatus { get; set; }
public string? MinimumDirectXVersion { get; set; }
Expand Down
13 changes: 13 additions & 0 deletions MSStore.CLI.UnitTests/BaseCommandLineTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,19 @@ protected void AddDefaultFakeSuccessfulSubmission()
});
}

protected void AddDefaultFakeSuccessfulFlightSubmission()
{
AddDefaultFakeFlightSubmission();
InitDefaultFlightSubmissionStatusResponseQueue();

FakeStorePackagedAPI
.Setup(x => x.CommitFlightSubmissionAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<CancellationToken>()))
.ReturnsAsync(new DevCenterCommitResponse
{
Status = "CommitStarted",
});
}

protected void SetupNpmInstall(DirectoryInfo dirInfo)
{
ExternalCommandExecutor
Expand Down
29 changes: 29 additions & 0 deletions MSStore.CLI.UnitTests/PublishCommandUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,34 @@ public async Task PublishCommandForMSIXAppsWithNoCommitShouldNotCommit()

result.Should().Contain("Skipping submission commit.");
}

[TestMethod]
public async Task PublishCommandShouldSucceedForFlights()
{
var path = CopyFilesRecursively("MSIXProject");

var msixPath = Path.Combine(path, "test.msix");

AddFakeFlights();
AddDefaultFakeSuccessfulFlightSubmission();

var result = await ParseAndInvokeAsync(
new string[]
{
"publish",
msixPath,
"--appId",
FakeApps[0].Id!,
"--flightId",
FakeFlights[0].FlightId!,
"--verbose"
});

ZipFileManager
.Verify(x => x.ExtractZip(It.IsAny<string>(), It.IsAny<string>()), Times.Never);

result.Should().Contain("Submission commit success! Here is some data:");
result.Should().Contain("test.msix");
}
}
}
1 change: 1 addition & 0 deletions MSStore.CLI/Helpers/IStorePackagedAPIExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ public static async Task<int> PublishAsync(
{
FlightPackages = devCenterFlightSubmission.FlightPackages?.Select(p => new FlightPackageUpdate
{
Id = p.Id,
FileName = p.FileName,
FileStatus = p.FileStatus,
MinimumDirectXVersion = p.MinimumDirectXVersion,
Expand Down

0 comments on commit fa756b8

Please sign in to comment.