Skip to content

Commit

Permalink
add unittest workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
defgsus committed Nov 8, 2023
1 parent f62a9d2 commit 78f5758
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: test

on:
push:
branches: ["main", "development"]
pull_request:
branches: ["main", "development"]

jobs:

test-ubuntu:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
mongodb-version: ["3.6"]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: ${{ matrix.mongodb-version }}

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m venv env
source env/bin/activate
pip install -r requirements.txt
- name: Run tests
run: |
source env/bin/activate
./run_tests.sh
2 changes: 1 addition & 1 deletion bad/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _to_bool(x: str) -> bool:
DATA_PATH: Path = config("BAD_DATA_PATH", default=Path("~/").expanduser(), cast=Path)
TEMP_PATH: Path = config(
"BAD_TEMP_PATH",
default=str(Path(tempfile.gettempdir()) / "brainage-pipeline"),
default=str(Path(tempfile.gettempdir()) / "brainage-designer"),
cast=Path,
)

Expand Down
4 changes: 2 additions & 2 deletions bad/process/processdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import signal
import uuid
import traceback
from typing import Mapping, Any, Optional, Union, Sequence
from typing import Mapping, Any, Optional, Union, Sequence, List

import pymongo
from pymongo.database import Collection, List
from pymongo.database import Collection

from bad.db import DatabaseMixin
from bad import logger
Expand Down

0 comments on commit 78f5758

Please sign in to comment.