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

Local development and CI using test containers #207

Open
Meir017 opened this issue May 7, 2024 · 5 comments
Open

Local development and CI using test containers #207

Meir017 opened this issue May 7, 2024 · 5 comments
Labels
cleanup Code cleanup and other maintenance changes that do not affect runtime behavior

Comments

@Meir017
Copy link

Meir017 commented May 7, 2024

Using test containers (https://dotnet.testcontainers.org/) will improve the developer experience and allow having a cross platform CI without maintaining anything in the environment (other than having docker installed)

@madelson
Copy link
Owner

madelson commented May 8, 2024

I agree this would be a great idea, especially if it can create and easy path towards enabling a larger portion of the suite to run through GitHub actions.

@Meir017 is this something you’re interested in contributing? If so, let’s discuss what the implications would be for the code base and developer experience.

@madelson madelson added the cleanup Code cleanup and other maintenance changes that do not affect runtime behavior label May 8, 2024
@Meir017
Copy link
Author

Meir017 commented May 9, 2024

@madelson I'll be happy to contribute here.
I was thinking of starting with the Redis provider here - I'll need to see how to enable just a subset of the test to make this be a gradual effort

From what I see on other projects using test-containers, we could just use the ubuntu image (see https://github.com/actions/runner-images/blob/ubuntu22/20240212.1/images/ubuntu/Ubuntu2204-Readme.md having docker already installed, and a working example https://github.com/filipsnastins/testcontainers-github-actions/actions/runs/7959995426/job/21728056781?pr=80)

@madelson
Copy link
Owner

madelson commented May 9, 2024

Redis makes sense as a place to start. The tests are pretty well organized by namespace/category (and more could be done if that’s not sufficient), so it shouldn’t be terribly difficult to run just the redis tests through nunit.

@douglasg14b
Copy link

douglasg14b commented May 24, 2024

If you're talking about black box tests, you can standup a test environment in github actions with docker-compose, and run tests against those environments. You can add an abstraction over it with Tilt if desired.

This has the advantage of not leaking the test env into your code, but afaik is fundamentally the same as testcontainers 🤔

You end up just standup up the envs for redis, postgres....etc using their already existing images. It's quite convenient :)

@Meir017
Copy link
Author

Meir017 commented May 24, 2024

@douglasg14b would this affect the local development experience? Would developers still need to install locally thr different dependencies?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code cleanup and other maintenance changes that do not affect runtime behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants