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

Use dockertest to instantiate the test database #164

Open
ngehrsitz opened this issue Nov 2, 2023 · 2 comments
Open

Use dockertest to instantiate the test database #164

ngehrsitz opened this issue Nov 2, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@ngehrsitz
Copy link

This project would benefit from using dockertest to dynamically launch the database instance required for the tests.

@shueybubbles
Copy link
Collaborator

It looks promising. It would be fine for some tests but the setup needed for many scenarios is more complex. We have to test SSPI auth, Always Encrypted, named pipes, etc.
Today we rely on docker to test against SQL server on Linux in the github actions, and we rely on Appveyor to cover Windows SQL instances.
Presumably the helper function that returns the connection could switch over to dockertest if there's no .connstr file and no environment variable set. It would reduce the work needed for a new contributor to get tests running locally.

@ngehrsitz
Copy link
Author

Dockertest is not limited to just using func TestMain(m *testing.M) for the setup. You can just as well use it with a custom setupMyScenario() that is different for every test.
Github Actions will also just work by default as long as you have docker available in them. The only place I see the need for a .connstr as fallback would be the Windows test environments.

@dlevy-msft dlevy-msft added the enhancement New feature or request label Nov 28, 2023
@dlevy-msft dlevy-msft added this to the Backlog milestone Nov 28, 2023
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

No branches or pull requests

3 participants