Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
closing connection once data diff is executed (#785)
Browse files Browse the repository at this point in the history
* closing connection once data diff is executed

Signed-off-by: Sarad Mohanan <[email protected]>

* typo fix

Signed-off-by: Sarad Mohanan <[email protected]>

* moving database to with block

Signed-off-by: Sarad Mohanan <[email protected]>

* optimizing _data_diff function

Signed-off-by: Sarad Mohanan <[email protected]>

* minor

Signed-off-by: Sarad Mohanan <[email protected]>

* minor

Signed-off-by: Sarad Mohanan <[email protected]>

* bug fix

Signed-off-by: Sarad Mohanan <[email protected]>

* linter fixes

Signed-off-by: Sarad Mohanan <[email protected]>

* formating code

Signed-off-by: Sarad Mohanan <[email protected]>

* update CONTRIBUTING.md and cleanup ansi escape sequences

Signed-off-by: Sarad Mohanan <[email protected]>

* read postgres db config from common.CONN_STRINGS

Signed-off-by: Sarad Mohanan <[email protected]>

* defaulting postgres port

Signed-off-by: Sarad Mohanan <[email protected]>

* test

Signed-off-by: Sarad Mohanan <[email protected]>

* test for __main__

Signed-off-by: Sarad Mohanan <[email protected]>

* adding close db connection test

Signed-off-by: Sarad Mohanan <[email protected]>

* update test case

Signed-off-by: Sarad Mohanan <[email protected]>

* do not use shared connection

Signed-off-by: Sarad Mohanan <[email protected]>

* no connection sharing

Signed-off-by: Sarad Mohanan <[email protected]>

* no connection sharing

Signed-off-by: Sarad Mohanan <[email protected]>

* avoid list typing

Signed-off-by: Sarad Mohanan <[email protected]>

* Update tests/test_main.py

Co-authored-by: Sung Won Chung <[email protected]>

* Update tests/test_main.py

Co-authored-by: Sung Won Chung <[email protected]>

* Apply suggestions from code review

Co-authored-by: Sung Won Chung <[email protected]>

* Update tests/test_database.py

Co-authored-by: Sung Won Chung <[email protected]>

* minor

Signed-off-by: Sarad Mohanan <[email protected]>

* minor

Signed-off-by: Sarad Mohanan <[email protected]>

* minor

Signed-off-by: Sarad Mohanan <[email protected]>

* minor

Signed-off-by: Sarad Mohanan <[email protected]>

* merging 784

Signed-off-by: Sarad Mohanan <[email protected]>

* remove redundant variable

Signed-off-by: Sarad Mohanan <[email protected]>

---------

Signed-off-by: Sarad Mohanan <[email protected]>
Co-authored-by: Sung Won Chung <[email protected]>
  • Loading branch information
sar009 and sungchun12 authored Jan 22, 2024
1 parent cc79e11 commit d2161cc
Show file tree
Hide file tree
Showing 12 changed files with 633 additions and 267 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,6 @@ benchmark_*.png
.vscode

# History
.history
.history

docker-compose-local.yml
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Make sure to update the appropriate `TEST_*_CONN_STRING`, so that it will be inc

#### Run the tests

You can run the tests with `unittest`.
You can run the tests with `python -m unittest`.

When running against multiple databases, the tests can take a long while.

Expand Down Expand Up @@ -111,6 +111,15 @@ $ poetry install # Install dependencies
$ docker-compose up -d mysql postgres # run mysql and postgres dbs in background
```

If you want to change the configuration of docker-compose and run the DB containers, copy docker-compose.yml into docker-compose-local.yml, make changes and run
```shell-session
$ cp docker-compose.yml docker-compose-local.yml
$ docker-compose -f docker-compose-local.yml up -d mysql postgres # run mysql and postgres dbs in background
```
you will also have to set up `tests/local_settings.py` where `TEST_*_CONN_STRING` can be edited

`docker-compose-local.yml` and `tests/local_settings.py` is git ignored so should not show up in git changes.

[docker-compose]: https://docs.docker.com/compose/install/

**3. Run Unit Tests**
Expand Down
Loading

0 comments on commit d2161cc

Please sign in to comment.