From f3890a1668bc99cd8280a37044b5f35e57a05fc6 Mon Sep 17 00:00:00 2001 From: Hayden Date: Sat, 16 Jan 2021 17:14:35 -0900 Subject: [PATCH] refactor: rename test -> tests --- .github/workflows/pytest.yml | 65 ++++++++++-------- mealie/{test => tests}/__init__.py | 0 mealie/{test => tests}/conftest.py | 0 ...s-rapps-with-rice-and-sunflower-seeds.html | 0 .../html-raw/healthy_pasta_bake_60759.html | 0 .../Air Fryer Shrimp/recipe.json | 0 .../Air Fryer Shrimp/thumb.jpg | Bin .../Chicken Parmigiana/recipe.json | 0 .../Chicken Parmigiana/thumb.jpg | Bin .../Skillet Shepherd's Pie/recipe.json | 0 .../data/nextcloud_recipes/nextcloud.zip | Bin ...oblauch-Champignon-Paprika-vegan.html.json | 0 .../best-homemade-salsa-recipe.json | 0 ...balls-with-raspberry-balsamic-glaze-2.json | 0 .../data/recipes-raw/bon_appetit.json | 0 .../data/recipes-raw/chunky-apple-cake.json | 0 .../dairy-free-impossible-pumpkin-pie.json | 0 .../how-to-make-instant-pot-spaghetti.json | 0 .../instant-pot-chicken-and-potatoes.json | 0 .../instant-pot-kerala-vegetable-stew.json | 0 .../data/recipes-raw/jalapeno-popper-dip.json | 0 .../microwave_sweet_potatoes_04783.json | 0 ...rt-steak-with-roasted-pepper-couscous.json | 0 mealie/{test => tests}/pytest.ini | 0 .../test_migrations/__init__.py | 0 .../test_migrations/test_nextcloud.py | 0 .../{test => tests}/test_recipes/__init__.py | 0 .../test_recipes/test_scraper.py | 0 28 files changed, 36 insertions(+), 29 deletions(-) rename mealie/{test => tests}/__init__.py (100%) rename mealie/{test => tests}/conftest.py (100%) rename mealie/{test => tests}/data/html-raw/carottes-rapps-with-rice-and-sunflower-seeds.html (100%) rename mealie/{test => tests}/data/html-raw/healthy_pasta_bake_60759.html (100%) rename mealie/{test => tests}/data/nextcloud_recipes/Air Fryer Shrimp/recipe.json (100%) rename mealie/{test => tests}/data/nextcloud_recipes/Air Fryer Shrimp/thumb.jpg (100%) rename mealie/{test => tests}/data/nextcloud_recipes/Chicken Parmigiana/recipe.json (100%) rename mealie/{test => tests}/data/nextcloud_recipes/Chicken Parmigiana/thumb.jpg (100%) rename mealie/{test => tests}/data/nextcloud_recipes/Skillet Shepherd's Pie/recipe.json (100%) rename mealie/{test => tests}/data/nextcloud_recipes/nextcloud.zip (100%) rename mealie/{test => tests}/data/recipes-raw/Pizza-Knoblauch-Champignon-Paprika-vegan.html.json (100%) rename mealie/{test => tests}/data/recipes-raw/best-homemade-salsa-recipe.json (100%) rename mealie/{test => tests}/data/recipes-raw/blue-cheese-stuffed-turkey-meatballs-with-raspberry-balsamic-glaze-2.json (100%) rename mealie/{test => tests}/data/recipes-raw/bon_appetit.json (100%) rename mealie/{test => tests}/data/recipes-raw/chunky-apple-cake.json (100%) rename mealie/{test => tests}/data/recipes-raw/dairy-free-impossible-pumpkin-pie.json (100%) rename mealie/{test => tests}/data/recipes-raw/how-to-make-instant-pot-spaghetti.json (100%) rename mealie/{test => tests}/data/recipes-raw/instant-pot-chicken-and-potatoes.json (100%) rename mealie/{test => tests}/data/recipes-raw/instant-pot-kerala-vegetable-stew.json (100%) rename mealie/{test => tests}/data/recipes-raw/jalapeno-popper-dip.json (100%) rename mealie/{test => tests}/data/recipes-raw/microwave_sweet_potatoes_04783.json (100%) rename mealie/{test => tests}/data/recipes-raw/moroccan-skirt-steak-with-roasted-pepper-couscous.json (100%) rename mealie/{test => tests}/pytest.ini (100%) rename mealie/{test => tests}/test_migrations/__init__.py (100%) rename mealie/{test => tests}/test_migrations/test_nextcloud.py (100%) rename mealie/{test => tests}/test_recipes/__init__.py (100%) rename mealie/{test => tests}/test_recipes/test_scraper.py (100%) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ff7da207e..e3db6fbfc 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -14,36 +14,43 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + #---------------------------------------------- + # check-out repo and set-up python + #---------------------------------------------- + - name: Check out repository + uses: actions/checkout@v2 + - name: Set up python + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 + #---------------------------------------------- + # ----- install & configure poetry ----- + #---------------------------------------------- - name: Install Poetry - uses: dschep/install-poetry-action@v1.2 - - name: Install Poetry - uses: dschep/install-poetry-action@v1.2 - - - name: Cache Poetry virtualenv - uses: actions/cache@v1 - id: cache + uses: snok/install-poetry@v1.1.1 with: - path: ~/.virtualenvs - key: poetry-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - poetry-${{ hashFiles('**/poetry.lock') }} - - - name: Set Poetry config - run: | - poetry config settings.virtualenvs.in-project false - poetry config settings.virtualenvs.path ~/.virtualenvs - - - name: Install Dependencies + virtualenvs-create: true + virtualenvs-in-project: true + #---------------------------------------------- + # load cached venv if cache exists + #---------------------------------------------- + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + #---------------------------------------------- + # install dependencies if cache does not exist + #---------------------------------------------- + - name: Install dependencies run: poetry install - if: steps.cache.outputs.cache-hit != 'true' - - - name: Code Quality - run: poetry run black . --check - - - name: Test with pytest - run: poetry run pytest --cov . -n 2 + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + #---------------------------------------------- + # run test suite + #---------------------------------------------- + - name: Run tests + run: | + source .venv/bin/activate + pytest mealie/tests/ + coverage report diff --git a/mealie/test/__init__.py b/mealie/tests/__init__.py similarity index 100% rename from mealie/test/__init__.py rename to mealie/tests/__init__.py diff --git a/mealie/test/conftest.py b/mealie/tests/conftest.py similarity index 100% rename from mealie/test/conftest.py rename to mealie/tests/conftest.py diff --git a/mealie/test/data/html-raw/carottes-rapps-with-rice-and-sunflower-seeds.html b/mealie/tests/data/html-raw/carottes-rapps-with-rice-and-sunflower-seeds.html similarity index 100% rename from mealie/test/data/html-raw/carottes-rapps-with-rice-and-sunflower-seeds.html rename to mealie/tests/data/html-raw/carottes-rapps-with-rice-and-sunflower-seeds.html diff --git a/mealie/test/data/html-raw/healthy_pasta_bake_60759.html b/mealie/tests/data/html-raw/healthy_pasta_bake_60759.html similarity index 100% rename from mealie/test/data/html-raw/healthy_pasta_bake_60759.html rename to mealie/tests/data/html-raw/healthy_pasta_bake_60759.html diff --git a/mealie/test/data/nextcloud_recipes/Air Fryer Shrimp/recipe.json b/mealie/tests/data/nextcloud_recipes/Air Fryer Shrimp/recipe.json similarity index 100% rename from mealie/test/data/nextcloud_recipes/Air Fryer Shrimp/recipe.json rename to mealie/tests/data/nextcloud_recipes/Air Fryer Shrimp/recipe.json diff --git a/mealie/test/data/nextcloud_recipes/Air Fryer Shrimp/thumb.jpg b/mealie/tests/data/nextcloud_recipes/Air Fryer Shrimp/thumb.jpg similarity index 100% rename from mealie/test/data/nextcloud_recipes/Air Fryer Shrimp/thumb.jpg rename to mealie/tests/data/nextcloud_recipes/Air Fryer Shrimp/thumb.jpg diff --git a/mealie/test/data/nextcloud_recipes/Chicken Parmigiana/recipe.json b/mealie/tests/data/nextcloud_recipes/Chicken Parmigiana/recipe.json similarity index 100% rename from mealie/test/data/nextcloud_recipes/Chicken Parmigiana/recipe.json rename to mealie/tests/data/nextcloud_recipes/Chicken Parmigiana/recipe.json diff --git a/mealie/test/data/nextcloud_recipes/Chicken Parmigiana/thumb.jpg b/mealie/tests/data/nextcloud_recipes/Chicken Parmigiana/thumb.jpg similarity index 100% rename from mealie/test/data/nextcloud_recipes/Chicken Parmigiana/thumb.jpg rename to mealie/tests/data/nextcloud_recipes/Chicken Parmigiana/thumb.jpg diff --git a/mealie/test/data/nextcloud_recipes/Skillet Shepherd's Pie/recipe.json b/mealie/tests/data/nextcloud_recipes/Skillet Shepherd's Pie/recipe.json similarity index 100% rename from mealie/test/data/nextcloud_recipes/Skillet Shepherd's Pie/recipe.json rename to mealie/tests/data/nextcloud_recipes/Skillet Shepherd's Pie/recipe.json diff --git a/mealie/test/data/nextcloud_recipes/nextcloud.zip b/mealie/tests/data/nextcloud_recipes/nextcloud.zip similarity index 100% rename from mealie/test/data/nextcloud_recipes/nextcloud.zip rename to mealie/tests/data/nextcloud_recipes/nextcloud.zip diff --git a/mealie/test/data/recipes-raw/Pizza-Knoblauch-Champignon-Paprika-vegan.html.json b/mealie/tests/data/recipes-raw/Pizza-Knoblauch-Champignon-Paprika-vegan.html.json similarity index 100% rename from mealie/test/data/recipes-raw/Pizza-Knoblauch-Champignon-Paprika-vegan.html.json rename to mealie/tests/data/recipes-raw/Pizza-Knoblauch-Champignon-Paprika-vegan.html.json diff --git a/mealie/test/data/recipes-raw/best-homemade-salsa-recipe.json b/mealie/tests/data/recipes-raw/best-homemade-salsa-recipe.json similarity index 100% rename from mealie/test/data/recipes-raw/best-homemade-salsa-recipe.json rename to mealie/tests/data/recipes-raw/best-homemade-salsa-recipe.json diff --git a/mealie/test/data/recipes-raw/blue-cheese-stuffed-turkey-meatballs-with-raspberry-balsamic-glaze-2.json b/mealie/tests/data/recipes-raw/blue-cheese-stuffed-turkey-meatballs-with-raspberry-balsamic-glaze-2.json similarity index 100% rename from mealie/test/data/recipes-raw/blue-cheese-stuffed-turkey-meatballs-with-raspberry-balsamic-glaze-2.json rename to mealie/tests/data/recipes-raw/blue-cheese-stuffed-turkey-meatballs-with-raspberry-balsamic-glaze-2.json diff --git a/mealie/test/data/recipes-raw/bon_appetit.json b/mealie/tests/data/recipes-raw/bon_appetit.json similarity index 100% rename from mealie/test/data/recipes-raw/bon_appetit.json rename to mealie/tests/data/recipes-raw/bon_appetit.json diff --git a/mealie/test/data/recipes-raw/chunky-apple-cake.json b/mealie/tests/data/recipes-raw/chunky-apple-cake.json similarity index 100% rename from mealie/test/data/recipes-raw/chunky-apple-cake.json rename to mealie/tests/data/recipes-raw/chunky-apple-cake.json diff --git a/mealie/test/data/recipes-raw/dairy-free-impossible-pumpkin-pie.json b/mealie/tests/data/recipes-raw/dairy-free-impossible-pumpkin-pie.json similarity index 100% rename from mealie/test/data/recipes-raw/dairy-free-impossible-pumpkin-pie.json rename to mealie/tests/data/recipes-raw/dairy-free-impossible-pumpkin-pie.json diff --git a/mealie/test/data/recipes-raw/how-to-make-instant-pot-spaghetti.json b/mealie/tests/data/recipes-raw/how-to-make-instant-pot-spaghetti.json similarity index 100% rename from mealie/test/data/recipes-raw/how-to-make-instant-pot-spaghetti.json rename to mealie/tests/data/recipes-raw/how-to-make-instant-pot-spaghetti.json diff --git a/mealie/test/data/recipes-raw/instant-pot-chicken-and-potatoes.json b/mealie/tests/data/recipes-raw/instant-pot-chicken-and-potatoes.json similarity index 100% rename from mealie/test/data/recipes-raw/instant-pot-chicken-and-potatoes.json rename to mealie/tests/data/recipes-raw/instant-pot-chicken-and-potatoes.json diff --git a/mealie/test/data/recipes-raw/instant-pot-kerala-vegetable-stew.json b/mealie/tests/data/recipes-raw/instant-pot-kerala-vegetable-stew.json similarity index 100% rename from mealie/test/data/recipes-raw/instant-pot-kerala-vegetable-stew.json rename to mealie/tests/data/recipes-raw/instant-pot-kerala-vegetable-stew.json diff --git a/mealie/test/data/recipes-raw/jalapeno-popper-dip.json b/mealie/tests/data/recipes-raw/jalapeno-popper-dip.json similarity index 100% rename from mealie/test/data/recipes-raw/jalapeno-popper-dip.json rename to mealie/tests/data/recipes-raw/jalapeno-popper-dip.json diff --git a/mealie/test/data/recipes-raw/microwave_sweet_potatoes_04783.json b/mealie/tests/data/recipes-raw/microwave_sweet_potatoes_04783.json similarity index 100% rename from mealie/test/data/recipes-raw/microwave_sweet_potatoes_04783.json rename to mealie/tests/data/recipes-raw/microwave_sweet_potatoes_04783.json diff --git a/mealie/test/data/recipes-raw/moroccan-skirt-steak-with-roasted-pepper-couscous.json b/mealie/tests/data/recipes-raw/moroccan-skirt-steak-with-roasted-pepper-couscous.json similarity index 100% rename from mealie/test/data/recipes-raw/moroccan-skirt-steak-with-roasted-pepper-couscous.json rename to mealie/tests/data/recipes-raw/moroccan-skirt-steak-with-roasted-pepper-couscous.json diff --git a/mealie/test/pytest.ini b/mealie/tests/pytest.ini similarity index 100% rename from mealie/test/pytest.ini rename to mealie/tests/pytest.ini diff --git a/mealie/test/test_migrations/__init__.py b/mealie/tests/test_migrations/__init__.py similarity index 100% rename from mealie/test/test_migrations/__init__.py rename to mealie/tests/test_migrations/__init__.py diff --git a/mealie/test/test_migrations/test_nextcloud.py b/mealie/tests/test_migrations/test_nextcloud.py similarity index 100% rename from mealie/test/test_migrations/test_nextcloud.py rename to mealie/tests/test_migrations/test_nextcloud.py diff --git a/mealie/test/test_recipes/__init__.py b/mealie/tests/test_recipes/__init__.py similarity index 100% rename from mealie/test/test_recipes/__init__.py rename to mealie/tests/test_recipes/__init__.py diff --git a/mealie/test/test_recipes/test_scraper.py b/mealie/tests/test_recipes/test_scraper.py similarity index 100% rename from mealie/test/test_recipes/test_scraper.py rename to mealie/tests/test_recipes/test_scraper.py