testcontainers / testcontainers/testcontainers-java
Implement withDatabase() in MSSQLServerContainer
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 8.7k
- Forks
- 1.9k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 9
Descripción
Hello,
First of all, thanks for your great work!
I have a requirement to set READ_COMMITED_SNAPSHOT ON in the MSSQLServer database, and due to a MSSQLServer limitation that can't be applied to the default master database:
ALTER DATABASE master SET READ_COMMITTED_SNAPSHOT ON
throws
SQL Error [5058] [S0002]: Option 'READ_COMMITTED_SNAPSHOT' cannot be set in database 'master'.
This setting prevents read locks from being created and is the default setting in AzureSQL DB - in my case with testContainers my integration tests intermittently fail with CouldNotAquireLockException because of that.
For this to work OOTB for me I think the MSSQLServerContainer class would have to have the withDatabaseName() method implemented, and add the logic for creating the database before letting the application code connect to it.
I managed to get by by subclassing the MSSQLServerContainer, but it would be great to have it OOTB.
I can provide a PR if that's helpful.
Thanks!
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza leyendo MSSQLServerContainer y buscando patrones existentes de configuración del nombre de la base de datos. Sigue cómo se inicializa el contenedor antes de las conexiones de la aplicación y ejecuta las pruebas de integración pertinentes. Se considera terminado cuando withDatabaseName() crea y utiliza una base de datos que no es master, con la configuración solicitada disponible.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- docker, java
- Área
- databases, testing
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 30/100