From b51c2f46ad8e182f1ca43afbb1a4111fb265c6db Mon Sep 17 00:00:00 2001 From: WangSL <48207171+WSL0809@users.noreply.github.com> Date: Thu, 28 Mar 2024 15:52:40 +0800 Subject: [PATCH] bugfix --- .github/workflows/docker-build.yml | 36 +++++++++++++++--------------- test.py | 23 ------------------- tests/test_get_all_rooms.py | 0 3 files changed, 18 insertions(+), 41 deletions(-) delete mode 100644 test.py create mode 100644 tests/test_get_all_rooms.py diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 107b6ae..aaca47f 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,18 +1,18 @@ -name: Build and Push Docker Image - -on: - push: - branches: - - master - -jobs: - build_and_push: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag wangsl0809/yuezi_server:${{ github.sha }} - - name: Login to DockerHub - run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - name: Push the Docker image to DockerHub - run: docker push wangsl0809/yuezi_server:${{ github.sha }} +#name: Build and Push Docker Image +# +#on: +# push: +# branches: +# - master +# +#jobs: +# build_and_push: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - name: Build the Docker image +# run: docker build . --file Dockerfile --tag wangsl0809/yuezi_server:${{ github.sha }} +# - name: Login to DockerHub +# run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin +# - name: Push the Docker image to DockerHub +# run: docker push wangsl0809/yuezi_server:${{ github.sha }} diff --git a/test.py b/test.py deleted file mode 100644 index f2cf4ac..0000000 --- a/test.py +++ /dev/null @@ -1,23 +0,0 @@ -from sqlalchemy import select -from sqlalchemy.orm import Session - -import model -import models -import schema -from database import engine, SessionLocal - -models.Base.metadata.create_all(bind=engine) - -db = SessionLocal() - - -def get_room_by_id(db: Session, room_id: int): - query = select( - model.Room.id, model.Room.status, model.Room.recently_used, model.Room.notes - ).where(model.Room.id == room_id) - id, status, recently_used, notes = db.execute(query).first() - return schema.Room(id=id, status=status, recently_used=recently_used, notes=notes) - - -result = get_room_by_id(db, 0) -print(result) diff --git a/tests/test_get_all_rooms.py b/tests/test_get_all_rooms.py new file mode 100644 index 0000000..e69de29