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

Sort test results by name, improve duration calculation #12

Merged
merged 1 commit into from
Jul 4, 2024
Merged

Conversation

kzu
Copy link
Member

@kzu kzu commented Jul 4, 2024

By sorting tests by name we make it easier to find visually those that belong logically together.

While doing this change, we switch to adding the duration of each individual test counted test run, which is more precise than adding the overal test results file duration which can include a full run from a previous trx (i.e. a later one run partially only failed tests, for example).

@kzu kzu added the enhancement New feature or request label Jul 4, 2024
@kzu kzu enabled auto-merge (rebase) July 4, 2024 05:55
@kzu kzu disabled auto-merge July 4, 2024 05:55
@devlooped devlooped deleted a comment from devlooped-bot Jul 4, 2024
@devlooped devlooped deleted a comment from devlooped-bot Jul 4, 2024
@devlooped devlooped deleted a comment from devlooped-bot Jul 4, 2024
@devlooped-bot
Copy link
Member

👉 Run 8 tests in ~ 3 seconds
5 passed
2 failed
1 skipped

🧪 Details
❌ Demo.Tests.Fails_With_Complex_StackTrace
   at Demo.Tests.Unexpected() in /_/src/Demo/Tests.cs:line 43
   at Demo.Tests.Run() in /_/src/Demo/Tests.cs:line 41
   at Demo.Tests.<Fails_With_Complex_StackTrace>b__6_0() in /_/src/Demo/Tests.cs:line 36
   at Demo.Tests.Fails_With_Complex_StackTrace() in /_/src/Demo/Tests.cs:line 38
❌ Demo.Tests.Fails_With_Output
   at Demo.Tests.Fails_With_Output() in /_/src/Demo/Tests.cs:line 30

> It was going so well...
> Yet you never know
> Which is why you sprinkle all these WriteLines 👀

✅ Demo.Tests.Parameterized(culture: "de")
✅ Demo.Tests.Parameterized(culture: "en")
✅ Demo.Tests.Parameterized(culture: "es")
✅ Demo.Tests.Parameterized(culture: "fr")
❔ Demo.Tests.Skipped_Test_Does_Not_Run => Shouldn't run for now :)

✅ Demo.Tests.Test_With_Output

> Hello, world from xunit ITestOutputHelper!

from dotnet-trx with 💜

By sorting tests by name we make it easier to find visually those that belong logically together.

While doing this change, we switch to adding the duration of each individual test counted test run, which is more precise than adding the overal test results file duration which can include a full run from a previous trx (i.e. a later one run partially only failed tests, for example).
@devlooped-bot
Copy link
Member

👉 Run 8 tests in ~ 3 seconds
     ✅ 5 passed
     ❌ 2 failed
     ❔ 1 skipped

🧪 Details
❌ Demo.Tests.Fails_With_Complex_StackTrace
   at Demo.Tests.Unexpected() in /_/src/Demo/Tests.cs:line 43
   at Demo.Tests.Run() in /_/src/Demo/Tests.cs:line 41
   at Demo.Tests.<Fails_With_Complex_StackTrace>b__6_0() in /_/src/Demo/Tests.cs:line 36
   at Demo.Tests.Fails_With_Complex_StackTrace() in /_/src/Demo/Tests.cs:line 38
❌ Demo.Tests.Fails_With_Output
   at Demo.Tests.Fails_With_Output() in /_/src/Demo/Tests.cs:line 30

> It was going so well...
> Yet you never know
> Which is why you sprinkle all these WriteLines 👀

✅ Demo.Tests.Parameterized(culture: "de")
✅ Demo.Tests.Parameterized(culture: "en")
✅ Demo.Tests.Parameterized(culture: "es")
✅ Demo.Tests.Parameterized(culture: "fr")
❔ Demo.Tests.Skipped_Test_Does_Not_Run => Shouldn't run for now :)

✅ Demo.Tests.Test_With_Output

> Hello, world from xunit ITestOutputHelper!

from dotnet-trx with 💜

@kzu kzu enabled auto-merge (rebase) July 4, 2024 06:22
@kzu kzu merged commit cf1386d into main Jul 4, 2024
7 checks passed
@kzu kzu deleted the dev/sort branch July 4, 2024 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants