From 8a13310562fe81b7a1226fa76aef763a3f14afa1 Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Fri, 12 Jan 2024 00:31:46 +0900 Subject: [PATCH 1/7] =?UTF-8?q?chore:=20=EB=B0=B1=EC=97=94=EB=93=9C=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EA=B9=83=ED=97=99=20=EC=95=A1?= =?UTF-8?q?=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-backend-app.yaml | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/test-backend-app.yaml diff --git a/.github/workflows/test-backend-app.yaml b/.github/workflows/test-backend-app.yaml new file mode 100644 index 0000000..373a42e --- /dev/null +++ b/.github/workflows/test-backend-app.yaml @@ -0,0 +1,32 @@ +name: Test backend app + +on: + pull_request: + branches: [dev, main] + push: + branches: [dev, main] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: setup python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: install dependencies + uses: abatilo/actions-poetry@v2 + with: + poetry-version: 1.6.1 + + # - uses: actions/cache@v2 + # with: + # path: ${{ env.pythonLocation }} + # key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} + + - name: test app + run: python -m pytest tests -c pytest.ini From e8e5c542d1ceb9fa3f0ad3df7cda1f5d4e487205 Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Fri, 12 Jan 2024 00:32:09 +0900 Subject: [PATCH 2/7] =?UTF-8?q?chore:=20=EC=97=86=EB=8A=94=20=EB=B8=8C?= =?UTF-8?q?=EB=9E=9C=EC=B9=98=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-backend-app.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-backend-app.yaml b/.github/workflows/test-backend-app.yaml index 373a42e..011c6db 100644 --- a/.github/workflows/test-backend-app.yaml +++ b/.github/workflows/test-backend-app.yaml @@ -2,9 +2,9 @@ name: Test backend app on: pull_request: - branches: [dev, main] + branches: [main] push: - branches: [dev, main] + branches: [main] jobs: test: From cee6484194ec484d196b5b0b7570d22b342af5c4 Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Fri, 12 Jan 2024 00:45:15 +0900 Subject: [PATCH 3/7] =?UTF-8?q?test:=20pytest=20pyproject=EC=97=90=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/poetry.lock | 8 ++++---- backend/pyproject.toml | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/poetry.lock b/backend/poetry.lock index ae5bca0..e790754 100644 --- a/backend/poetry.lock +++ b/backend/poetry.lock @@ -718,13 +718,13 @@ rsa = ["cryptography"] [[package]] name = "pytest" -version = "7.4.3" +version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, - {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, + {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, + {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, ] [package.dependencies] @@ -1015,4 +1015,4 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "6bda3c7da76e279786b5aed023de6117fcb1511f5d128cd09d6e4538043c23f7" +content-hash = "c72a9518d1b82411b8e37b800444fbde5f509655ab3af7a507703c368d586d7b" diff --git a/backend/pyproject.toml b/backend/pyproject.toml index d00bd89..15386a9 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -26,6 +26,7 @@ pytest-dotenv = "^0.5.2" faker = "^21.0.0" httpx = "^0.26.0" aiosqlite = "^0.19.0" +pytest = "^7.4.4" [build-system] requires = ["poetry-core"] From 5c9488e0e6f1fa1323c3436fc43f485ff2a764b2 Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Fri, 12 Jan 2024 00:52:50 +0900 Subject: [PATCH 4/7] =?UTF-8?q?chore:=20test-backend-app=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-backend-app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-backend-app.yaml b/.github/workflows/test-backend-app.yaml index 011c6db..8432536 100644 --- a/.github/workflows/test-backend-app.yaml +++ b/.github/workflows/test-backend-app.yaml @@ -29,4 +29,4 @@ jobs: # key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} - name: test app - run: python -m pytest tests -c pytest.ini + run: poetry run python -m pytest tests -c pytest.ini From 9fca5b281418323425765881b2c45312e9316d0d Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Fri, 12 Jan 2024 00:56:47 +0900 Subject: [PATCH 5/7] =?UTF-8?q?chore:=20=EA=B9=83=ED=97=99=20=EC=97=91?= =?UTF-8?q?=EC=85=98=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=9B=8C=ED=82=B9=20=EB=94=94=EB=A0=89?= =?UTF-8?q?=ED=84=B0=EB=A6=AC=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-backend-app.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-backend-app.yaml b/.github/workflows/test-backend-app.yaml index 8432536..5d78a19 100644 --- a/.github/workflows/test-backend-app.yaml +++ b/.github/workflows/test-backend-app.yaml @@ -30,3 +30,4 @@ jobs: - name: test app run: poetry run python -m pytest tests -c pytest.ini + working-directory: ./backend From 296c89d2ca1de05cab0901e84ced008c52e14121 Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Fri, 12 Jan 2024 01:08:14 +0900 Subject: [PATCH 6/7] =?UTF-8?q?chore:=20=EA=B9=83=ED=97=99=20=EC=97=91?= =?UTF-8?q?=EC=85=98=EC=97=90=20=EB=9D=BC=EC=9D=B4=EB=B8=8C=EB=9F=AC?= =?UTF-8?q?=EB=A6=AC=20=EC=84=A4=EC=B9=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-backend-app.yaml | 27 ++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-backend-app.yaml b/.github/workflows/test-backend-app.yaml index 5d78a19..0c0b828 100644 --- a/.github/workflows/test-backend-app.yaml +++ b/.github/workflows/test-backend-app.yaml @@ -9,6 +9,8 @@ on: jobs: test: runs-on: ubuntu-latest + env: + working-directory: ./backend steps: - uses: actions/checkout@v3 @@ -18,16 +20,27 @@ jobs: with: python-version: "3.10" - - name: install dependencies + - name: install poetry uses: abatilo/actions-poetry@v2 with: poetry-version: 1.6.1 - - # - uses: actions/cache@v2 - # with: - # path: ${{ env.pythonLocation }} - # key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} + + - name: setup a local virtual environment + run: | + poetry config virtualenvs.create true --local + poetry config virtualenvs.in-project true --local + + - uses: actions/cache@v3 + name: Define a cache for the virtual environment based on the dependencies lock file + with: + path: ./.venv + key: venv-${{ hashFiles('poetry.lock') }} + working-directory: ${{env.working-directory}} + + - name: install the project dependencies + run: poetry install + working-directory: ${{env.working-directory}} - name: test app run: poetry run python -m pytest tests -c pytest.ini - working-directory: ./backend + working-directory: ${{env.working-directory}} From 7a27fc42dede3c741afde9942d10fb01f5adf70d Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Fri, 12 Jan 2024 01:10:35 +0900 Subject: [PATCH 7/7] =?UTF-8?q?chore:=20=EA=B9=83=ED=97=99=20=EC=97=91?= =?UTF-8?q?=EC=85=98=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-backend-app.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-backend-app.yaml b/.github/workflows/test-backend-app.yaml index 0c0b828..db10a0d 100644 --- a/.github/workflows/test-backend-app.yaml +++ b/.github/workflows/test-backend-app.yaml @@ -33,9 +33,8 @@ jobs: - uses: actions/cache@v3 name: Define a cache for the virtual environment based on the dependencies lock file with: - path: ./.venv + path: ${{env.working-directory}}/.venv key: venv-${{ hashFiles('poetry.lock') }} - working-directory: ${{env.working-directory}} - name: install the project dependencies run: poetry install