From e098561bdd60e1a5e84d6d62b3ef83a31ff3a0a9 Mon Sep 17 00:00:00 2001 From: Prafful Sharma <115104695+DraKen0009@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:46:35 +0530 Subject: [PATCH] Fixing tests and adding workflows (#3) --- .github/workflows/test-plugin-integration.yml | 56 +++++++++++++++++ camera/migrations/0001_initial.py | 6 +- ...121_1505.py => 0002_auto_20241206_0242.py} | 5 +- ...er_positionpreset_created_date_and_more.py | 23 +++++++ {tests => camera/tests}/__init__.py | 0 .../tests}/test_camera_preset_apis.py | 63 ++++++++++++++++++- setup.py | 4 +- tests/test_onvif_validations.py | 52 --------------- 8 files changed, 148 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/test-plugin-integration.yml rename camera/migrations/{0002_auto_20241121_1505.py => 0002_auto_20241206_0242.py} (88%) create mode 100644 camera/migrations/0003_alter_positionpreset_created_date_and_more.py rename {tests => camera/tests}/__init__.py (100%) rename {tests => camera/tests}/test_camera_preset_apis.py (65%) delete mode 100644 tests/test_onvif_validations.py diff --git a/.github/workflows/test-plugin-integration.yml b/.github/workflows/test-plugin-integration.yml new file mode 100644 index 0000000..167714c --- /dev/null +++ b/.github/workflows/test-plugin-integration.yml @@ -0,0 +1,56 @@ +name: Run Tests with Docker + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Print branch name + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + run: | + echo "Branch name: $BRANCH_NAME" + shell: bash + + # Checkout the ohcnetwork/care repository + - name: Checkout ohcnetwork/care repository + uses: actions/checkout@v3 + with: + repository: DraKen0009/care + ref: adding-camera-plugin + + + # Update the plug_config.py file with the required content + - name: Update plug_config.py + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + run: | + cat > ./plug_config.py <