You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 13, 2020. It is now read-only.
Merge pull request #13 from PageUpPeopleOrg/feature/OSC-1238_ci-cd
[OSC-1238] Add CI/CD
Overview
Integration with Travis CI! 🎉
Add Pipenv support (highly recommended to manage dependencies/venv)
Add PyTest for when we do write unit tests
Changes
Add build status to README.md
Add .travis.yml
Add Pipfile and Pipfile.lock
Add tests folder directory
Contains integration and unit tests
Rename psycopg2 dependency to psycopg2-binary
Update setup.py to reflect changes
Notes
CI/CD
Travis builds will perform two types of testing:
Unit testing
Integration testing
Integration tests perform the following:
Create stub load models
a. load_model_1.json, load_model_2.json
Initialise a new execution
Compare load models and assert that the models changed are * (as no models have been compared)
Complete execution and assert that last successful execution ID is the one returned from init
Initalise another execution
Modify load_model_1.json
Compare load models and assert that models changed are load_model_1.json
Complete execution and assert that last successful execution ID is the one returned from init
-`complete-execution`: Marks the completion of an existing execution by updating a record for the same in the given database. Returns nothing unless there's an error.
39
32
-`execution-id`: a GUID identifier of an existing data pipeline execution as returned by the `init` command.
40
33
41
-
### As a script
42
-
43
-
- Use a local isolated/virtual python environment for this project
2. Use a local isolated/virtual python environment for this project
96
-
3. Install project dependencies
97
-
4. Develop and test code changes
98
-
5. Once done, deactivate the virtual environment
77
+
### Install dependencies
99
78
100
-
### Install pre-requisites
79
+
To install project dependencies, run the following command:
101
80
102
-
#### Python 3
81
+
```
82
+
$ pipenv install
83
+
```
103
84
104
-
Install from [here](https://www.python.org/)_(or your choice of safe software provider)_. During installation, choose the option to _Add to PATH_ and _Custom Installation_ so you can provide the install path to not be the default `C:\Program Files\Python37\` and be outside the `Program Files` directory to say, `C:\Python37\`. This is just a suggestion since there have been issues with updating key python packages once Python is installed within `Program Files` on Windows.
85
+
### Activate Virtual Environment
105
86
106
-
Verify your installation by running the below commands.
87
+
To activate a virtual environment, run the following command:
107
88
108
-
```powershell
109
-
py --version
110
-
python --version
111
-
pip --version
89
+
```
90
+
$ pipenv shell
112
91
```
113
92
114
-
If you end up with multiple accidental/purposeful python installations, use the below in Windows Commandline to figure out where the executables are located.
93
+
### Using MCD
115
94
116
-
```cmd
117
-
where py
118
-
where python
119
-
where pip
120
-
```
95
+
Once the virtual environment has been activated, please refer to [usage](#Usage) for how to use MCD.
96
+
97
+
## Testing
98
+
99
+
To run integration tests locally, it is highly recommended that [Docker](https://www.docker.com/) is installed.
100
+
101
+
### Unit Tests
121
102
122
-
### Use a local isolated/virtual python environment for this project
If you build with `--system-site-packages` directory, your virtual environment will be allowed access to packages from your global site-packages directory. Although, if you want isolation from the global system, do not use this flag. Once you've created a new environment, you need to activate the same.
109
+
### Integration Tests
127
110
128
-
On Windows:
111
+
To run integration tests, please ensure the following information is configured correctly:
0 commit comments