Skip to content

Commit 8a92203

Browse files
committed
Update CI unit tests to use Makefile
This will be essential after later commits as the existence of SECRET_KEY in .env or environment is going to be non-optional. Signed-off-by: Hritik Vijay <hritikxx8@gmail.com>
1 parent 381221c commit 8a92203

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

.github/workflows/main.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ jobs:
1818
- name: Restore cache
1919
uses: actions/cache@v2
2020
with:
21-
path: .venv
21+
path: venv
2222
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }}
2323
restore-keys: |
2424
${{ runner.os }}-venv-
2525
26+
- name: Create env file
27+
run: make envfile
28+
2629
- name: Install dependencies
2730
run: |
28-
sudo apt install python3-dev postgresql libpq-dev build-essential libxml2-dev libxslt1-dev postgresql ncat
31+
sudo apt install python3-dev postgresql libpq-dev build-essential libxml2-dev libxslt1-dev postgresql
2932
python -m pip install --upgrade pip
3033
3134
- uses: syphar/restore-virtualenv@v1
@@ -39,17 +42,13 @@ jobs:
3942
- run: pip install -r requirements.txt -r requirements-dev.txt
4043
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
4144

45+
# virtualenv is already activated
4246
- name: Setup database
43-
env:
44-
PGPASSWORD: vulnerablecode
4547
run: |
4648
sudo systemctl start postgresql
47-
sudo -Eu postgres psql -c "CREATE ROLE vulnerablecode WITH PASSWORD '$PGPASSWORD' NOSUPERUSER CREATEDB NOCREATEROLE INHERIT LOGIN;"
48-
sudo systemctl status postgresql
49-
createdb --encoding=utf-8 --owner=vulnerablecode --user=vulnerablecode \
50-
--host=localhost --port=5432 vulnerablecode
49+
make postgres ACTIVATE=
5150
5251
- name: Run tests
53-
run: python -m pytest -v -m "not webtest"
52+
run: make test ACTIVATE=
5453
env:
5554
GH_TOKEN: 1

0 commit comments

Comments
 (0)