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

Nice idea ! #1

Open
StefH opened this issue May 29, 2024 · 6 comments
Open

Nice idea ! #1

StefH opened this issue May 29, 2024 · 6 comments

Comments

@StefH
Copy link

StefH commented May 29, 2024

Hello @fredimachado,

I had the same idea : building a WireMock.Net Aspire implementation.
I did also start on this here:
WireMock-Net/WireMock.Net#1109

Your idea of using the MappingBuildder is very interesting! I did copy your idea for this and added it also to the wip PR.

@fredimachado
Copy link
Owner

fredimachado commented May 29, 2024

Hey @StefH , that's awesome!

I had a quick look at your implementation just now, and I notice mine is super simplistic compared to yours.
I'm looking forward to trying your package as soon as it's available.

Nice profile pic btw. I finally had some time to practice cubing this year, and I managed to solve it. It took months, but I'm already able to solve it in about 1 minute. Not sure if that's super good, specially because I don't plan to break any records, but it's a really nice feeling to be able to solve it.

@StefH
Copy link
Author

StefH commented May 29, 2024

I've uploaded this NuGet just now: WireMock.Net.Aspire 0.0.1-preview-02 which includes all the code from the current state of the PR.

You can try it.

@StefH
Copy link
Author

StefH commented May 29, 2024

BTW I noticed that the hooks are executed after a bit of delay.

Do you know if it's possible in Aspire to "wait" until the wiremock.net server has fully started?
Just like it's possible with TestContainers: https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net.Testcontainers/WireMockContainerBuilder.cs#L160

@fredimachado
Copy link
Owner

fredimachado commented May 29, 2024

You might be able to solve this with Aspirant package. There is a WaitFor extension method that you can use put in any resource that needs to wait for the WireMock container to be running and ready.
https://github.com/aspirant-project/aspirant/blob/main/src/Aspirant.Hosting/WaitForDependencies/WaitForDependenciesExtensions.cs

Here's how I used it: https://github.com/fredimachado/NCafe/blob/main/src/Aspire/NCafe.AppHost/Program.cs

You might have to implement a Health Check, because Aspirant uses it for the WaitFor.

@StefH
Copy link
Author

StefH commented May 31, 2024

Did you have time to try that preview version?

@StefH
Copy link
Author

StefH commented Jun 4, 2024

@fredimachado
I solved it at this moment by waiting on the availability from the /__admin/health endpoint. Latest preview 5 should fix this.

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

No branches or pull requests

2 participants