From 8d0a8f2d7b75100211b87126f490ab7331652dd3 Mon Sep 17 00:00:00 2001 From: kyokukou Date: Thu, 19 Oct 2023 11:11:10 -0700 Subject: [PATCH 1/4] copy of browse autotesting file --- .github/ISSUE_TEMPLATE/python-app.yml | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/python-app.yml diff --git a/.github/ISSUE_TEMPLATE/python-app.yml b/.github/ISSUE_TEMPLATE/python-app.yml new file mode 100644 index 00000000..c887c7c1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/python-app.yml @@ -0,0 +1,39 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest poetry + poetry install + #- name: Lint with flake8 + # run: | + # # stop the build if there are Python syntax errors or undefined names + # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + poetry run pytest tests \ No newline at end of file From 3f17ded680037092055049a31593da853b6ba0ff Mon Sep 17 00:00:00 2001 From: kyokukou Date: Thu, 19 Oct 2023 11:45:10 -0700 Subject: [PATCH 2/4] mistake fixes --- .github/{ISSUE_TEMPLATE => workflows}/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/{ISSUE_TEMPLATE => workflows}/python-app.yml (97%) diff --git a/.github/ISSUE_TEMPLATE/python-app.yml b/.github/workflows/python-app.yml similarity index 97% rename from .github/ISSUE_TEMPLATE/python-app.yml rename to .github/workflows/python-app.yml index c887c7c1..9fd4e5f7 100644 --- a/.github/ISSUE_TEMPLATE/python-app.yml +++ b/.github/workflows/python-app.yml @@ -36,4 +36,4 @@ jobs: # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - poetry run pytest tests \ No newline at end of file + poetry run pytest \ No newline at end of file From c4c5fcfdee316bbd9f34a0cf704dcc57e5a761c5 Mon Sep 17 00:00:00 2001 From: kyokukou Date: Thu, 19 Oct 2023 11:51:25 -0700 Subject: [PATCH 3/4] specified python version --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 9fd4e5f7..b1a37163 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Python 3.10 uses: actions/setup-python@v3 with: - python-version: "3.10" + python-version: "3.10.9" - name: Install dependencies run: | python -m pip install --upgrade pip From 83470960588e28b84e742c7bd4b8e5890172e0ca Mon Sep 17 00:00:00 2001 From: kyokukou Date: Thu, 19 Oct 2023 12:58:31 -0700 Subject: [PATCH 4/4] startup check not to run during testing --- .github/workflows/python-app.yml | 2 +- search/factory.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b1a37163..c02a3571 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -36,4 +36,4 @@ jobs: # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - poetry run pytest \ No newline at end of file + TESTING=ON poetry run pytest \ No newline at end of file diff --git a/search/factory.py b/search/factory.py index a639a793..88f74f3c 100644 --- a/search/factory.py +++ b/search/factory.py @@ -49,7 +49,8 @@ def create_ui_web_app() -> Flask: for filter_name, template_filter in filters.filters: app.template_filter(filter_name)(template_filter) - index_startup_check(app) + if app.config["TESTING"] =="ON": + index_startup_check(app) return app