Skip to content

Conversation

@mhbuck
Copy link
Contributor

@mhbuck mhbuck commented Sep 12, 2025

I was working on a project and upgrading test kits and I came across the issue with the Persistence test kit being xunit 2 only

This is a proof of concept of how I think potentially can handle the other test kits similar to how the base testkit has been created. I have only tried this out on the Persistence test kit so far just to see if the approach is what should be used for the others.

</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\contrib\testkits\Akka.TestKit.Xunit\Akka.TestKit.Xunit.csproj" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pulling the reference in here brings in xunit v3

using Actor;
using Akka.TestKit.Xunit;
using Configuration;
using Xunit;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only changes to this file are the xunit references the rest is a full copy of the file. What theoretically could be done is creating a base class of the PersistenceTestKit in the base library and only have the constructors in the two xunit specific projects to minimise the copied code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There have been no other ways around duplicating the code that I can think of here without the references

</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\contrib\testkits\Akka.TestKit.Xunit2\Akka.TestKit.Xunit2.csproj" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this would be a breaking change someone could be referencing this project and only using the Akka.TestKit and not the Akka.Persistence.TestKit Not sure if it would be a problem but just calling that out

@mhbuck
Copy link
Contributor Author

mhbuck commented Sep 15, 2025

I wanted to see if I could get the Persistence tests all running using the new project and I was able to hack out quite a bit of data to get parts of the tests in a position to run with xunit3 and it has mostly worked. There are quite a few things that rely on some xunit v2 references but it does "prove" the new project added works.
image

@mhbuck mhbuck marked this pull request as ready for review September 15, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant