From de40e733ecf3e4cf26138aa835e9df33045d2aa9 Mon Sep 17 00:00:00 2001 From: Anton Larin Date: Mon, 4 Sep 2023 18:01:11 +0200 Subject: [PATCH 1/3] add simple test to make a PR to check CodeCov --- tests/test_app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_app.py b/tests/test_app.py index 8ae9ee340..c9ea017a6 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -1,4 +1,4 @@ -from application.app import get_vectorstore +from application.app import get_vectorstore, is_azure_configured import os @@ -26,3 +26,7 @@ def test_default_active_docs(): def test_complex_active_docs(): data = {"active_docs": "local/other/path"} assert get_vectorstore(data) == os.path.join("application", "indexes/local/other/path") + + +def test_is_asure_configured(): + assert not is_azure_configured() From 14284e0cc774833e641816d9ec282b9cff74611f Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 4 Sep 2023 18:25:41 +0100 Subject: [PATCH 2/3] Update test_app.py --- tests/test_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_app.py b/tests/test_app.py index c9ea017a6..a86234aee 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -28,5 +28,5 @@ def test_complex_active_docs(): assert get_vectorstore(data) == os.path.join("application", "indexes/local/other/path") -def test_is_asure_configured(): +def test_is_azure_configured(): assert not is_azure_configured() From c1581b69f4f9b84f8fe7432d8bb87d85d739be00 Mon Sep 17 00:00:00 2001 From: Anton Larin Date: Mon, 4 Sep 2023 19:32:39 +0200 Subject: [PATCH 3/3] small optimization --- .github/workflows/pytest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b7d97f919..f191efe31 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -21,8 +21,9 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with pytest and generate coverage report run: | - python -m pytest --cov=application --cov=scripts --cov=extensions --cov-report xml:/tmp/coverage.xml + python -m pytest --cov=application --cov=scripts --cov=extensions --cov-report=xml - name: Upload coverage reports to Codecov + if: github.event_name == 'pull_request' && matrix.python-version == '3.11' uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}