Skip to content
5 changes: 5 additions & 0 deletions src/VirtualClient/VirtualClient.Contracts/Enumerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public enum ErrorReason : int
/// </summary>
DiskFilterNotSupported = 301,

/// <summary>
/// Process failed execution.
/// </summary>
ProcessFailed = 313,

/// <summary>
/// The workload failed during execution.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ public static async Task<IProcessProxy> ExecuteCommandAsync(
beforeExecution?.Invoke(process);
await process.StartAndWaitAsync(cancellationToken)
.ConfigureAwait(false);

await component.LogProcessDetailsAsync(process, telemetryContext, logToFile: true);
process.ThrowIfErrored<ProcessException>(process.StandardError.ToString(), ErrorReason.ProcessFailed);
}

return process;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public void MySQLServerConfigurationThrowsExceptionWhenConfigureServerProcessIsE
this.fixture.Process.OnHasExited = () => true;

using TestMySQLServerConfiguration component = new TestMySQLServerConfiguration(this.fixture);
DependencyException exception = Assert.ThrowsAsync<DependencyException>(() => component.ExecuteAsync(CancellationToken.None));
Assert.AreEqual(ErrorReason.DependencyInstallationFailed, exception.Reason);
ProcessException exception = Assert.ThrowsAsync<ProcessException>(() => component.ExecuteAsync(CancellationToken.None));
Assert.AreEqual(ErrorReason.ProcessFailed, exception.Reason);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public void PostgreSQLServerConfigurationThrowsExceptionWhenConfigureServerProce
};

using TestPostgreSQLServerConfiguration component = new TestPostgreSQLServerConfiguration(this.fixture);
DependencyException exception = Assert.ThrowsAsync<DependencyException>(() => component.ExecuteAsync(CancellationToken.None));
Assert.AreEqual(ErrorReason.DependencyInstallationFailed, exception.Reason);
ProcessException exception = Assert.ThrowsAsync<ProcessException>(() => component.ExecuteAsync(CancellationToken.None));
Assert.AreEqual(ErrorReason.ProcessFailed, exception.Reason);
}

[Test]
Expand Down
Loading