From 8ce6ee8c28192bc01917b5b80adc4334f0921afb Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 11:22:09 +0900 Subject: [PATCH 01/16] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E5=AE=9F?= =?UTF-8?q?=E9=A8=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 102 +++++++++++++++++------------------ 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f583d83..f5818ea 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,62 +1,56 @@ # This is a basic workflow to help you get started with Actions -#name: pytest +name: pytest -#permissions: write-all +permissions: write-all # Controls when the workflow will run -#on: -# Triggers the workflow on push or pull request events but only for the "develop" branch -# push: -# branches: ["develop", "main"] -# pull_request: -# branches: ["develop", "main"] +on: + # Triggers the workflow on push or pull request events but only for the "develop" branch + push: + branches: ["develop", "main"] + pull_request: + branches: ["develop", "main"] -# Allows you to run this workflow manually from the Actions tab -# workflow_dispatch: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel -#jobs: -# This workflow contains a single job called "pytest" -# pytest: -# The type of runner that the job will run on -# runs-on: ubuntu-latest - -# Steps represent a sequence of tasks that will be executed as part of the job -# steps: -# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it -# - uses: actions/checkout@v3 - -# - name: Test with pytest on Docker -# run: | -# touch ./app/.env -# echo DB_HOST=db >> ./app/.env -# echo MYSQL_USER=docker_dev >> ./app/.env -# echo MYSQL_PASSWORD=cRH1eL4GbNZkFXlk >> ./app/.env -# echo BIND-ADDRESS=0.0.0.0 >> ./app/.env -# echo MYSQL_RANDOM_ROOT_PASSWORD=yes >> ./app/.env -# echo MYSQL_DATABASE=quaint-app >> ./app/.env -# docker-compose up -d -# docker-compose exec -T app bash -# ./wait-for-it.sh - -# - name: Create Coverage Comment -# id: coverageComment -# uses: MishaKav/pytest-coverage-comment@main -# with: -# pytest-coverage-path: ./pytest-coverage.txt -# junitxml-path: ./app/test/pytest.xml - -# - name: Create Coverage Badge -# uses: schneegans/dynamic-badges-action@v1.3.0 -# with: -# auth: ${{ secrets.BADGE_GIST }} # 名前は適宜変更:手順5で決めたトークン名 -# gistID: 81370c9284b6c64224021c2c6520c2e3 #先ほど控えたGist ID -# 以降はコピペ可 -# cerverageCommentはPytest Coverage CommentのID -# 書き換えた場合は変更が必要 -# filename: pytest-coverage-comment.json -# label: Coverage -# message: ${{ steps.coverageComment.outputs.coverage }} -# color: ${{ steps.coverageComment.outputs.color }} -# namedLogo: python +jobs: + # This workflow contains a single job called "pytest" + pytest: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + - name: Test with pytest on Docker + run: | + pwd + ls + docker-compose up -d + docker-compose exec -T app bash /app/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt + + - name: Create Coverage Comment + id: coverageComment + uses: MishaKav/pytest-coverage-comment@main + with: + pytest-coverage-path: ./pytest-coverage.txt + junitxml-path: ./app/test/pytest.xml + + - name: Create Coverage Badge + uses: schneegans/dynamic-badges-action@v1.3.0 + with: + auth: ${{ secrets.BADGE_GIST }} # 名前は適宜変更:手順5で決めたトークン名 + gistID: 81370c9284b6c64224021c2c6520c2e3 #先ほど控えたGist ID + # 以降はコピペ可 + # cerverageCommentはPytest Coverage CommentのID + # 書き換えた場合は変更が必要 + filename: pytest-coverage-comment.json + label: Coverage + message: ${{ steps.coverageComment.outputs.coverage }} + color: ${{ steps.coverageComment.outputs.color }} + namedLogo: python From ae08d0735ae8f3bad8a6ad253330aef4d4d915e3 Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 11:26:02 +0900 Subject: [PATCH 02/16] =?UTF-8?q?workflow=E5=86=8D=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f5818ea..6797e54 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -31,6 +31,14 @@ jobs: run: | pwd ls + touch ./app/.env + echo DB_HOST=db >> ./app/.env + echo MYSQL_USER=docker_dev >> ./app/.env + echo MYSQL_PASSWORD=cRH1eL4GbNZkFXlk >> ./app/.env + echo BIND-ADDRESS=0.0.0.0 >> ./app/.env + echo MYSQL_RANDOM_ROOT_PASSWORD=yes >> ./app/.env + echo MYSQL_DATABASE=quaint-app >> ./app/.env + ls ./app docker-compose up -d docker-compose exec -T app bash /app/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt From 4efe049406129a364849c222a289d08d0a842bdc Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 11:29:41 +0900 Subject: [PATCH 03/16] =?UTF-8?q?wait-for-it=E3=81=AE=E3=83=91=E3=82=B9?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 6797e54..f84e293 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -29,8 +29,6 @@ jobs: - name: Test with pytest on Docker run: | - pwd - ls touch ./app/.env echo DB_HOST=db >> ./app/.env echo MYSQL_USER=docker_dev >> ./app/.env @@ -38,9 +36,8 @@ jobs: echo BIND-ADDRESS=0.0.0.0 >> ./app/.env echo MYSQL_RANDOM_ROOT_PASSWORD=yes >> ./app/.env echo MYSQL_DATABASE=quaint-app >> ./app/.env - ls ./app docker-compose up -d - docker-compose exec -T app bash /app/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt + docker-compose exec -T app bash /workflow/app/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt - name: Create Coverage Comment id: coverageComment From 45a2e6f3a328b23c4d940df5eeda76d6eb2c98bf Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 11:32:58 +0900 Subject: [PATCH 04/16] =?UTF-8?q?wait-for-it=E3=81=AE=E3=83=91=E3=82=B9?= =?UTF-8?q?=E5=86=8D=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f84e293..1289740 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -37,7 +37,7 @@ jobs: echo MYSQL_RANDOM_ROOT_PASSWORD=yes >> ./app/.env echo MYSQL_DATABASE=quaint-app >> ./app/.env docker-compose up -d - docker-compose exec -T app bash /workflow/app/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt + docker-compose exec -T app bash /workspace/app/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt - name: Create Coverage Comment id: coverageComment From 3297c5894d0e784c97c28973bf85d3050fc52b09 Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 11:34:56 +0900 Subject: [PATCH 05/16] =?UTF-8?q?=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 1289740..ca5676b 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -37,6 +37,8 @@ jobs: echo MYSQL_RANDOM_ROOT_PASSWORD=yes >> ./app/.env echo MYSQL_DATABASE=quaint-app >> ./app/.env docker-compose up -d + docker-compose exec -T app bash pwd + docker-compose exec -T app bash ls docker-compose exec -T app bash /workspace/app/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt - name: Create Coverage Comment From 1691afe2b0037880b43656d32a60ed7af5afcc84 Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 11:36:42 +0900 Subject: [PATCH 06/16] =?UTF-8?q?=E3=83=91=E3=82=B9=E5=86=8D=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ca5676b..d5e4e57 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -37,9 +37,7 @@ jobs: echo MYSQL_RANDOM_ROOT_PASSWORD=yes >> ./app/.env echo MYSQL_DATABASE=quaint-app >> ./app/.env docker-compose up -d - docker-compose exec -T app bash pwd - docker-compose exec -T app bash ls - docker-compose exec -T app bash /workspace/app/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt + docker-compose exec -T app bash /workspace/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt - name: Create Coverage Comment id: coverageComment From ed050082fd602e94babd7437e68a3bd10287ad7e Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 11:56:20 +0900 Subject: [PATCH 07/16] =?UTF-8?q?pytest=E5=AE=9F=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d5e4e57..c23f8c8 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -37,8 +37,9 @@ jobs: echo MYSQL_RANDOM_ROOT_PASSWORD=yes >> ./app/.env echo MYSQL_DATABASE=quaint-app >> ./app/.env docker-compose up -d - docker-compose exec -T app bash /workspace/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt - + docker-compose exec -it quaint-api-app-1 bash + pytest ./workspace/app/test + # docker-compose exec -T app bash /workspace/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt - name: Create Coverage Comment id: coverageComment uses: MishaKav/pytest-coverage-comment@main From a89db40554caa256ec46b61d2bd05562c3b332d2 Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 11:59:58 +0900 Subject: [PATCH 08/16] =?UTF-8?q?not=20found=20pytest=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c23f8c8..b8de3cb 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -37,9 +37,7 @@ jobs: echo MYSQL_RANDOM_ROOT_PASSWORD=yes >> ./app/.env echo MYSQL_DATABASE=quaint-app >> ./app/.env docker-compose up -d - docker-compose exec -it quaint-api-app-1 bash - pytest ./workspace/app/test - # docker-compose exec -T app bash /workspace/wait-for-it.sh db:3306 -t 60 -- pytest --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt + docker-compose exec -T app bash /workspace/wait-for-it.sh db:3306 -t 60 -- pytest ./workspace/app/test --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt - name: Create Coverage Comment id: coverageComment uses: MishaKav/pytest-coverage-comment@main From 0926281baab5ed2d5cf37ebe6de4a39efa2ae3cf Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 12:02:42 +0900 Subject: [PATCH 09/16] =?UTF-8?q?pytest=20not=20found=20=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E8=BF=BD=E5=8F=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker_startup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker_startup.sh b/docker_startup.sh index 1260fc0..d49e10d 100644 --- a/docker_startup.sh +++ b/docker_startup.sh @@ -4,4 +4,5 @@ python3 -m pip install --upgrade pip pip install -r ./requirements.txt chmod +x ./wait-for-it.sh bash ./wait-for-it.sh db:3306 -t 60 -- alembic upgrade head -uvicorn app.main:app --host 0.0.0.0 --reload \ No newline at end of file +uvicorn app.main:app --host 0.0.0.0 --reload +echo done \ No newline at end of file From ffaef22e7ede0082dd0223a2948b1ffc78f48b72 Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 12:04:49 +0900 Subject: [PATCH 10/16] =?UTF-8?q?requirements=E3=81=8C=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=82=92=E5=BE=85=E3=81=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker_startup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/docker_startup.sh b/docker_startup.sh index d49e10d..d460344 100644 --- a/docker_startup.sh +++ b/docker_startup.sh @@ -2,6 +2,7 @@ cd workspace python3 -m pip install --upgrade pip pip install -r ./requirements.txt +wait chmod +x ./wait-for-it.sh bash ./wait-for-it.sh db:3306 -t 60 -- alembic upgrade head uvicorn app.main:app --host 0.0.0.0 --reload From 0e3e80c24519a79bfff9d8658854ee81daa2b39a Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 12:14:43 +0900 Subject: [PATCH 11/16] =?UTF-8?q?docker=5Fstartup.sh=E3=82=92=E6=AD=A3?= =?UTF-8?q?=E3=81=97=E3=81=8F=E5=AE=9F=E8=A1=8C=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 3 ++- docker_startup.sh | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) mode change 100644 => 100755 docker_startup.sh diff --git a/docker-compose.yml b/docker-compose.yml index b7f3d67..e043aaa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,8 @@ services: - .:/workspace:cached ports: - "8000:8000" - command: /bin/bash /workspace/docker_startup.sh + command: > + /bin/sh -c 'chmod +x /workspace/docker_startup.sh && /workspace/docker_startup.sh' redis: image: "redis:latest" diff --git a/docker_startup.sh b/docker_startup.sh old mode 100644 new mode 100755 index d460344..1260fc0 --- a/docker_startup.sh +++ b/docker_startup.sh @@ -2,8 +2,6 @@ cd workspace python3 -m pip install --upgrade pip pip install -r ./requirements.txt -wait chmod +x ./wait-for-it.sh bash ./wait-for-it.sh db:3306 -t 60 -- alembic upgrade head -uvicorn app.main:app --host 0.0.0.0 --reload -echo done \ No newline at end of file +uvicorn app.main:app --host 0.0.0.0 --reload \ No newline at end of file From 89def96e4e4662be185c996bd717bdee53c4b376 Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 12:16:27 +0900 Subject: [PATCH 12/16] =?UTF-8?q?wait=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker_startup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/docker_startup.sh b/docker_startup.sh index 1260fc0..de794d1 100755 --- a/docker_startup.sh +++ b/docker_startup.sh @@ -2,6 +2,7 @@ cd workspace python3 -m pip install --upgrade pip pip install -r ./requirements.txt +wait chmod +x ./wait-for-it.sh bash ./wait-for-it.sh db:3306 -t 60 -- alembic upgrade head uvicorn app.main:app --host 0.0.0.0 --reload \ No newline at end of file From de1d6aea9ec901c3de6cf262708d9ad76e1606d4 Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 12:19:37 +0900 Subject: [PATCH 13/16] =?UTF-8?q?workflow=E3=81=ABwait=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b8de3cb..ffc0cca 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -37,6 +37,7 @@ jobs: echo MYSQL_RANDOM_ROOT_PASSWORD=yes >> ./app/.env echo MYSQL_DATABASE=quaint-app >> ./app/.env docker-compose up -d + wait docker-compose exec -T app bash /workspace/wait-for-it.sh db:3306 -t 60 -- pytest ./workspace/app/test --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt - name: Create Coverage Comment id: coverageComment From 712676c5e62e3f1ca21ba5829fc793a654dbedf8 Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 12:22:49 +0900 Subject: [PATCH 14/16] sleep --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ffc0cca..e7bbf7c 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -37,7 +37,7 @@ jobs: echo MYSQL_RANDOM_ROOT_PASSWORD=yes >> ./app/.env echo MYSQL_DATABASE=quaint-app >> ./app/.env docker-compose up -d - wait + sleep 60s docker-compose exec -T app bash /workspace/wait-for-it.sh db:3306 -t 60 -- pytest ./workspace/app/test --cov --junitxml=/app/app/test/pytest.xml --cov-report=term-missing:skip-covered > ./pytest-coverage.txt - name: Create Coverage Comment id: coverageComment From 1c40bc0eeb814c24402a49ebdfd7af7c20de47c5 Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 14:40:02 +0900 Subject: [PATCH 15/16] =?UTF-8?q?dotenv=E8=BF=BD=E5=8A=A0=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=82=89test=E9=80=9A=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config.py | 5 +++++ requirements.txt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/config.py b/app/config.py index e5541df..ffcf61f 100644 --- a/app/config.py +++ b/app/config.py @@ -1,8 +1,10 @@ import datetime import os +from dotenv import load_dotenv from pydantic import BaseSettings +load_dotenv() class Parameters(BaseSettings): person_per_user:int=3 # 1つのユーザーで同時入場できる人数 @@ -66,3 +68,6 @@ class Config: params=Parameters() settings= Settings() + +print("config") +print(settings.mysql_user) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e1c00c2..02562dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ hashids==1.3.1 jose==1.0.0 passlib==1.7.4 pydantic==1.10.6 -pytest==7.1.2 +pytest python_jose==3.3.0 requests SQLAlchemy==1.4.37 From a52c88ae00811562e873e3b54d590967a07a491f Mon Sep 17 00:00:00 2001 From: seigo Date: Tue, 26 Mar 2024 14:59:54 +0900 Subject: [PATCH 16/16] =?UTF-8?q?badge=E3=81=AE=E3=82=A2=E3=82=AF=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=AF=E4=B8=80=E6=97=A6=E6=B6=88=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e7bbf7c..704e597 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -45,17 +45,16 @@ jobs: with: pytest-coverage-path: ./pytest-coverage.txt junitxml-path: ./app/test/pytest.xml - - - name: Create Coverage Badge - uses: schneegans/dynamic-badges-action@v1.3.0 - with: - auth: ${{ secrets.BADGE_GIST }} # 名前は適宜変更:手順5で決めたトークン名 - gistID: 81370c9284b6c64224021c2c6520c2e3 #先ほど控えたGist ID - # 以降はコピペ可 - # cerverageCommentはPytest Coverage CommentのID - # 書き換えた場合は変更が必要 - filename: pytest-coverage-comment.json - label: Coverage - message: ${{ steps.coverageComment.outputs.coverage }} - color: ${{ steps.coverageComment.outputs.color }} - namedLogo: python +# - name: Create Coverage Badge +# uses: schneegans/dynamic-badges-action@v1.3.0 +# with: +# auth: ${{ secrets.BADGE_GIST }} # 名前は適宜変更:手順5で決めたトークン名 +# gistID: 81370c9284b6c64224021c2c6520c2e3 #先ほど控えたGist ID +# # 以降はコピペ可 +# # cerverageCommentはPytest Coverage CommentのID +# # 書き換えた場合は変更が必要 +# filename: pytest-coverage-comment.json +# label: Coverage +# message: ${{ steps.coverageComment.outputs.coverage }} +# color: ${{ steps.coverageComment.outputs.color }} +# namedLogo: python