-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Helper methods for database script execution #399
Comments
Shouldn't that be part of the Docker image?
Sounds good as long as it covers Windows containers (PowerShell scripts, etc.) too. |
This is an approach, but I'm looking for scenarios where it's easier to prepare the content of the container instead building a new image for each test case. Let's say we're building a data access component and we want to validate the behavior when the component uses an invalid user, user with wrong permissions, access a table that doesn't exists in the MySQL database. Instead of having an image for each case, it's easier to run a script to give wrong permissions to the user before the test.
Hm, I was thinking in having this feature only for specific databases modules (at least for now), not for generic images: running SQL scripts against MS SQL, MySQL, Oracle, Postgre; Lua scripts for Redis; N1QL for Couchbase. I've created a pull request #401 so we can easily discuss about this feature |
Ah I see. I was thinking about a "more" generic implementation like |
… function: ExecScript {Add function in the database modules to execute scripts}
… function: ExecScript {Add function in the database modules to execute scripts}
… function: ExecScript {Add function in the database modules to execute scripts}
… function: ExecScript {Add function in the database modules to execute scripts}
…cScript' {Add function in the database modules to execute scripts.}
…ntainerDatabase' {Add execution (chmod +x) flag with CopyFileAsync.}
…ntainerDatabase' {Add execution (chmod +x) flag with CopyFileAsync.}
Is your feature request related to a problem? Please describe.
If I need to run scripts to prepare the database before running tests against it, then I must code all the steps:
Describe the solution you'd like
A good way to make my test code smaller is creating a helper method in the database modules:
This
ExecScript
method can encapsulate the task of creating the script file, copying it inside the container and running the command line tool to execute it.The text was updated successfully, but these errors were encountered: