-
Notifications
You must be signed in to change notification settings - Fork 323
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
Fix string conversion of Microsoft.TestPlatform.Extensions.TrxLogger.ObjectMode.TestOutcome
#4243
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MarcoRossignoli
changed the title
Fix string conversion or Microsoft.TestPlatform.Extensions.TrxLogger.ObjectMode.TestOutcome
Fix string conversion or Jan 3, 2023
Microsoft.TestPlatform.Extensions.TrxLogger.ObjectMode.TestOutcome
MarcoRossignoli
changed the title
Fix string conversion or
Fix string conversion of Jan 3, 2023
Microsoft.TestPlatform.Extensions.TrxLogger.ObjectMode.TestOutcome
Microsoft.TestPlatform.Extensions.TrxLogger.ObjectMode.TestOutcome
MarcoRossignoli
changed the title
Fix string conversion of
[BREAKING CHANGE]Fix string conversion of Jan 3, 2023
Microsoft.TestPlatform.Extensions.TrxLogger.ObjectMode.TestOutcome
Microsoft.TestPlatform.Extensions.TrxLogger.ObjectMode.TestOutcome
using System.ComponentModel;
TestOutcome value = TestOutcome.Error;
Type valueType = value.GetType();
TypeConverter convert = TypeDescriptor.GetConverter(valueType);
var valueToSave = convert.ConvertToInvariantString(value);
Console.WriteLine(valueToSave);
internal enum TestOutcome
{
/// <summary>
/// There was a system error while we were trying to execute a test.
/// </summary>
Error,
/// <summary>
/// Test was executed, but there were issues.
/// Issues may involve exceptions or failed assertions.
/// </summary>
Failed,
/// <summary>
/// The test timed out
/// </summary>
Timeout,
/// <summary>
/// Test was aborted.
/// This was not caused by a user gesture, but rather by a framework decision.
/// </summary>
Aborted,
/// <summary>
/// Test has completed, but we can't say if it passed or failed.
/// May be used for aborted tests...
/// </summary>
Inconclusive,
/// <summary>
/// Test was executed w/o any issues, but run was aborted.
/// </summary>
PassedButRunAborted,
/// <summary>
/// Test had it chance for been executed but was not, as ITestElement.IsRunnable == false.
/// </summary>
NotRunnable,
/// <summary>
/// Test was not executed.
/// This was caused by a user gesture - e.g. user hit stop button.
/// </summary>
NotExecuted,
/// <summary>
/// Test run was disconnected before it finished running.
/// </summary>
Disconnected,
/// <summary>
/// To be used by Run level results.
/// This is not a failure.
/// </summary>
Warning,
/// <summary>
/// Test was executed w/o any issues.
/// </summary>
Passed,
/// <summary>
/// Test has completed, but there is no qualitative measure of completeness.
/// </summary>
Completed,
/// <summary>
/// Test is currently executing.
/// </summary>
InProgress,
/// <summary>
/// Test is in the execution queue, was not started yet.
/// </summary>
Pending,
/// <summary>
/// The min value of this enum
/// </summary>
Min = Error,
/// <summary>
/// The max value of this enum
/// </summary>
Max = Pending
} net6.0 output |
Evangelink
reviewed
Jan 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming this isn't tested as we didn't get any failure. Could we add a test?
src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs
Outdated
Show resolved
Hide resolved
…stOutcome.cs Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
…stOutcome.cs Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
…stOutcome.cs Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
MarcoRossignoli
changed the title
[BREAKING CHANGE]Fix string conversion of
Fix string conversion of Jan 4, 2023
Microsoft.TestPlatform.Extensions.TrxLogger.ObjectMode.TestOutcome
Microsoft.TestPlatform.Extensions.TrxLogger.ObjectMode.TestOutcome
We found out that the enum is internal and |
Evangelink
approved these changes
Jan 4, 2023
MarcoRossignoli
added a commit
to MarcoRossignoli/vstest
that referenced
this pull request
Jan 5, 2023
….ObjectMode.TestOutcome` (microsoft#4243) Fix string conversion of `Microsoft.TestPlatform.Extensions.TrxLogger.ObjectMode.TestOutcome`
MarcoRossignoli
pushed a commit
to MarcoRossignoli/vstest
that referenced
this pull request
Jan 6, 2023
…rxLogger.ObjectMode.TestOutcome` (microsoft#4243) (microsoft#4246)" This reverts commit 6b7b112.
MarcoRossignoli
added a commit
that referenced
this pull request
Jan 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By design we cannot have a "correct" value from a string conversion from enum for the same underlying value.
The behavior changed since 7.0 and now the runtime is returning
Min
and notError
fixed #4227