Skip to content

docs(ClickHouse): Add example #1421

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

digital88
Copy link
Contributor

What does this PR do?

Add ClickHouse example to modules section in docs.

Why is it important?

ClickHouse module docs are missing.

How to test this PR

Simply run docker compose up and access the docs at: http://localhost:8000.

Copy link

netlify bot commented Apr 14, 2025

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit 82adaaa
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-dotnet/deploys/6836b41202e068000882ba60
😎 Deploy Preview https://deploy-preview-1421--testcontainers-dotnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I haven't merged it yet because there was another one open that changed the ClickHouse tests (it adds the ADO.NET wait strategy: #1401). We'll need to update the documentation for this, similar to what we did for the other modules, I think.

Honestly, I don't think our current setup is ideal. The tests are optimized for testing, but not really for documentation purposes. Maybe it would make sense to use separate classes just for the documentation in the future. The original idea was to reference real source code in the docs to make sure everything compiles. But that's something we can discuss and address in a separate issue/PR.

Thanks again.

@digital88
Copy link
Contributor Author

there was another one open that changed the ClickHouse tests

Yes, it completely changed everything 😄 I just copied the old tests' code for docs, because new tests are more..massive? (at least for a quick docs example). They also cross reference another project, I don't see good way to include all this in docs examples...This boilerplate:

This example uses xUnit.net's IAsyncLifetime interface...

is now included in DbContainerFixture class in Testcontainers.Xunit project. I tried to use "scissors" --8<-- to reference the new tests in docs, but it's not that easy now. You either send reader straight to source code or include all base classes and base fixture classes in examples 😄

Copy link
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Sorry for the back and forth. What do you think about creating a separate file (something like ClickHouseContainerTest.docs.cs) alongside the test class? This file would contain the sources used for documentation.

We could make the test class partial, and then use a nested class just for documentation purposes. That way, we keep things clean and separate.

public abstract partial class ClickHouseContainerTest
{
    public sealed class Documentation
    {
        private readonly ClickHouseContainer _clickHouseContainer = new ClickHouseBuilder().Build();
    }
}

LMKWYT.

@digital88
Copy link
Contributor Author

Sorry for the back and forth. What do you think about creating a separate file (something like ClickHouseContainerTest.docs.cs) alongside the test class? This file would contain the sources used for documentation.

We could make the test class partial, and then use a nested class just for documentation purposes. That way, we keep things clean and separate.

public abstract partial class ClickHouseContainerTest
{
    public sealed class Documentation
    {
        private readonly ClickHouseContainer _clickHouseContainer = new ClickHouseBuilder().Build();
    }
}

LMKWYT.

Yes, this looks like a solution. Not sure why we need partial class?

@HofmeisterAn
Copy link
Collaborator

Yes, this looks like a solution. Not sure why we need partial class?

Oh, we don't need it. I just thought it might be nice to use a separate file to keep things organized, without mixing too much into one file (while keeping the same class name).

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.

2 participants