diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ba4008ae..a1846356 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/tests coveralls env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -45,15 +39,21 @@ jobs: strategy: matrix: - node-version: [17.x] + node-version: [20.8.x] # 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: ./frontend + run: npm ci + - name: Build packages + working-directory: ./frontend + run: npm run build --if-present + - name: Run tests + working-directory: ./frontend + run: npm run test diff --git a/api/pyproject.toml b/api/pyproject.toml index f64f510d..1be66260 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,17 @@ authors = [ {name = "Markus Johansson", email = "markus.h.johansson@skane.se"}, ] +[project.optional-dependencies] +test = [ + "black", + "isort", + "mypy", + "pytest", + "pytest-cov", + "pytest-flask", + "coveralls", +] + [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..cc486e99 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.coverage import _get_filepath def test_get_filepath(): diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f0ed5210..19d21738 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -15429,7 +15429,7 @@ "node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -16666,9 +16666,9 @@ } }, "node_modules/v8-to-istanbul/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "dev": true, "engines": { "node": ">= 8" 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",