diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ba4008ae..d4fa1cac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,36 +4,30 @@ on: ["push", "pull_request"] jobs: - test-python: + test-api-python: name: Coverage runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7] + python-version: [3.10, 3.11, 3.12] mongodb-version: ["3.6"] steps: - # Check out Scout code - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # Set up python - name: Set up Python ${{ matrix.python-version}} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version}} - - name: Production Dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -e . - pip install pytest-cov - pip install coveralls - - name: Test with pytest & Coveralls + pip install ./api[test] + - name: Test API with pytest & coveralls run: | - pip install -r requirements-dev.txt - pytest --cov=./ + pytest --cov ./api coveralls env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -49,11 +43,17 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm run build --if-present - - run: npm run test + - name: Install node packages + working-directory: ./api + run: npm ci + - name: Build packages + working-directory: ./api + run: npm run build --if-present + - name: Run tests + working-directory: ./api + run: npm run test diff --git a/api/pyproject.toml b/api/pyproject.toml index f64f510d..91296dcf 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -6,7 +6,6 @@ description = "Gens API" dependencies = [ "setuptools", "wheel", - "click", "requests", "fastapi[all]", "uvicorn[standard]", @@ -19,6 +18,16 @@ authors = [ {name = "Markus Johansson", email = "markus.h.johansson@skane.se"}, ] +[project.optional-dependencies] +test = [ + "black", + "isort", + "mypy", + "pytest", + "pytest-cov", + "pytest-flask", +] + [project.urls] Repository = "https://github.com/Clinical-Genomics-Lund/gens.git" Issues = "https://github.com/Clinical-Genomics-Lund/gens/issues" diff --git a/frontend/tests/test_io.py b/api/tests/test_io.py similarity index 83% rename from frontend/tests/test_io.py rename to api/tests/test_io.py index d7843e46..6cec98ed 100644 --- a/frontend/tests/test_io.py +++ b/api/tests/test_io.py @@ -1,11 +1,8 @@ """Test IO related functions.""" -import os -from unittest.mock import Mock - import pytest -from gens.io import _get_filepath +from app.io import _get_filepath def test_get_filepath(): diff --git a/frontend/pyproject.toml b/frontend/pyproject.toml index 5dac1f6b..e7c51e77 100644 --- a/frontend/pyproject.toml +++ b/frontend/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ ] [project.optional-dependencies] -dev = [ +test = [ "black", "isort", "mypy",