Skip to content

Commit 06a7220

Browse files
Add how to run tests to README (#8)
1 parent 41be4a5 commit 06a7220

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,43 @@ local result=""
185185
result="$(Sql__execute "SELECT * FROM people;")"
186186
```
187187

188+
## Running Tests
189+
190+
This project is fully tested, and is [using Travis](https://travis-ci.org/ash-shell/sql) to make sure all new code doesn't break anything. Feel free to check out the [test file](./test.sh) to see our tests.
191+
192+
If that's not enough for you, and you'd like to run the tests yourself to verify that everything works on your environment here are the following steps to run the tests:
193+
194+
First, you're going to have to create a `MySQL`, and `PostgreSQL` database. The name doesn't matter for either, but remember the names of the databases you've created.
195+
196+
Inside of both databases, create the following table:
197+
198+
```sql
199+
CREATE TABLE people(
200+
id integer,
201+
name varchar(20)
202+
);
203+
```
204+
205+
And seed it with the following data:
206+
207+
```sql
208+
INSERT INTO people VALUES
209+
(1, 'Brandon'),
210+
(2, 'Ryan'),
211+
(3, 'Rigby'),
212+
(4, 'Norbert');
213+
```
214+
215+
Next, we're going to have to set environment variables so we can point the tests to the databases. Look at the [Environment Variables(#environment-variables) section to see what variables you'll need set.
216+
217+
After the environment variables are set run the following:
218+
219+
```sh
220+
ash test github.com/ash-shell/sql
221+
```
222+
223+
Hopefully all of the tests passed. If not and you suspect it's due to a bug, please file an issue!
224+
188225
## License
189226

190227
[MIT](./LICENSE.md)

0 commit comments

Comments
 (0)