From b93f10fad4036ca62e1dc63ac5cbd1cf5cd9adfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=C5=A1a=20Kerec?= <61207502+kkeroo@users.noreply.github.com> Date: Tue, 7 Jan 2025 18:27:02 +0100 Subject: [PATCH] Tests: Update triggers & better reservation name. (#157) * Add trigger when pushed to main. * Add reservation name reflecting current GH job. * ImageManipV2 fix for alpha11. --- .github/workflows/e2e_tests.yaml | 16 ++++++++++++++-- .github/workflows/integration_tests.yaml | 5 +++-- tests/end_to_end/manual.py | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e_tests.yaml b/.github/workflows/e2e_tests.yaml index d2a259d..d183d6a 100644 --- a/.github/workflows/e2e_tests.yaml +++ b/.github/workflows/e2e_tests.yaml @@ -18,7 +18,14 @@ on: depthai-version: description: 'Version of depthai to install. Default: alpha6' required: true - default: '3.0.0a6' + default: '3.0.0a11' + push: + branches: + - main + paths: + - 'depthai_nodes/**' + - 'tests/end_to_end/**' + - .github/workflows/e2e_tests.yaml jobs: HIL-test: @@ -58,7 +65,12 @@ jobs: - name: Run Test run: | - CMD="hil --testbed ${{ github.event.inputs.testbed }} --wait --reservation-name 'depthai_nodes_ml_team' --commands 'cd /home/hil/depthai-nodes' 'git checkout main' 'git pull' 'git checkout ${{ github.event.inputs.branch }}' 'git pull' 'source venv/bin/activate' 'pip install --extra-index-url ${{secrets.LUXONIS_EXTRA_INDEX_URL}} depthai==${{ github.event.inputs.depthai-version }}' 'cd tests/end_to_end' 'source <(python setup_camera_ips.py)' 'export HUBAI_TEAM_ID=${{ secrets.HUBAI_TEAM_ID }}' 'export HUBAI_API_KEY=${{ secrets.HUBAI_API_KEY }}' 'python main.py ${{ github.event.inputs.additional-parameter }}' 'deactivate'" + export RESERVATION_NAME="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#${{ matrix.python-version}}" + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + CMD="hil --testbed ${{ github.event.inputs.testbed }} --wait --reservation-name $RESERVATION_NAME --commands 'cd /home/hil/depthai-nodes' 'git checkout main' 'git pull' 'git checkout ${{ github.event.inputs.branch }}' 'git pull' 'source venv/bin/activate' 'pip install --extra-index-url ${{secrets.LUXONIS_EXTRA_INDEX_URL}} depthai==${{ github.event.inputs.depthai-version }}' 'cd tests/end_to_end' 'source <(python setup_camera_ips.py)' 'export HUBAI_TEAM_SLUG=${{ secrets.HUBAI_TEAM_SLUG }}' 'export HUBAI_API_KEY=${{ secrets.HUBAI_API_KEY }}' 'python main.py ${{ github.event.inputs.additional-parameter }}' 'deactivate'" + else + CMD="hil --testbed oak4-pro --wait --reservation-name $RESERVATION_NAME --commands 'cd /home/hil/depthai-nodes' 'git checkout main' 'git pull' 'source venv/bin/activate' 'pip install --extra-index-url ${{secrets.LUXONIS_EXTRA_INDEX_URL}} depthai==3.0.0a11' 'cd tests/end_to_end' 'source <(python setup_camera_ips.py)' 'export HUBAI_TEAM_SLUG=${{ secrets.HUBAI_TEAM_SLUG }}' 'export HUBAI_API_KEY=${{ secrets.HUBAI_API_KEY }}' 'python main.py -all' 'deactivate'" + fi eval $CMD - name: Stop WireGuard diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index 6451268..77d81e7 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -65,10 +65,11 @@ jobs: - name: Run Test run: | + export RESERVATION_NAME="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#${{ matrix.python-version}}" if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - CMD="hil --testbed ${{ github.event.inputs.testbed }} --wait --reservation-name 'depthai_nodes_ml_team' --commands 'cd /home/hil/depthai-nodes' 'git checkout main' 'git pull' 'git checkout ${{ github.event.inputs.branch }}' 'git pull' 'source venv/bin/activate' 'pip install --extra-index-url ${{secrets.LUXONIS_EXTRA_INDEX_URL}} depthai==${{ github.event.inputs.depthai-version }}' 'cd tests/integration_tests' 'export B2_APPLICATION_KEY=${{ secrets.B2_APPLICATION_KEY }}' 'export B2_APPLICATION_KEY_ID=${{ secrets.B2_APPLICATION_KEY_ID }}' 'python main.py ${{ github.event.inputs.additional-parameter }}' 'deactivate'" + CMD="hil --testbed ${{ github.event.inputs.testbed }} --wait --reservation-name $RESERVATION_NAME --commands 'cd /home/hil/depthai-nodes' 'git checkout main' 'git pull' 'git checkout ${{ github.event.inputs.branch }}' 'git pull' 'source venv/bin/activate' 'pip install --extra-index-url ${{secrets.LUXONIS_EXTRA_INDEX_URL}} depthai==${{ github.event.inputs.depthai-version }}' 'cd tests/integration_tests' 'export B2_APPLICATION_KEY=${{ secrets.B2_APPLICATION_KEY }}' 'export B2_APPLICATION_KEY_ID=${{ secrets.B2_APPLICATION_KEY_ID }}' 'python main.py ${{ github.event.inputs.additional-parameter }}' 'deactivate'" else - CMD="hil --testbed oak4-s --wait --reservation-name 'depthai_nodes_ml_team' --commands 'cd /home/hil/depthai-nodes' 'git checkout main' 'git pull' 'git checkout ${{ github.head_ref }}' 'git pull' 'source venv/bin/activate' 'pip install --extra-index-url ${{secrets.LUXONIS_EXTRA_INDEX_URL}} depthai==3.0.0a11' 'cd tests/integration_tests' 'export B2_APPLICATION_KEY=${{ secrets.B2_APPLICATION_KEY }}' 'export B2_APPLICATION_KEY_ID=${{ secrets.B2_APPLICATION_KEY_ID }}' 'python main.py -all --download' 'deactivate'" + CMD="hil --testbed oak4-s --wait --reservation-name $RESERVATION_NAME --commands 'cd /home/hil/depthai-nodes' 'git checkout main' 'git pull' 'git checkout ${{ github.head_ref }}' 'git pull' 'source venv/bin/activate' 'pip install --extra-index-url ${{secrets.LUXONIS_EXTRA_INDEX_URL}} depthai==3.0.0a11' 'cd tests/integration_tests' 'export B2_APPLICATION_KEY=${{ secrets.B2_APPLICATION_KEY }}' 'export B2_APPLICATION_KEY_ID=${{ secrets.B2_APPLICATION_KEY_ID }}' 'python main.py -all --download' 'deactivate'" fi eval $CMD diff --git a/tests/end_to_end/manual.py b/tests/end_to_end/manual.py index b58f643..98cf6be 100644 --- a/tests/end_to_end/manual.py +++ b/tests/end_to_end/manual.py @@ -86,12 +86,12 @@ if input_size[0] % 2 != 0 or input_size[1] % 2 != 0: manip = pipeline.create(dai.node.ImageManipV2) - manip.initialConfig.addResize(input_size[0], input_size[1]) + manip.initialConfig.setOutputSize(input_size[0], input_size[1]) large_input_shape = (input_size[0] * 2, input_size[1] * 2) if input_size[0] < 128 and input_size[1] < 128: manip = pipeline.create(dai.node.ImageManipV2) - manip.initialConfig.addResize(input_size[0], input_size[1]) + manip.initialConfig.setOutputSize(input_size[0], input_size[1]) large_input_shape = (input_size[0] * 4, input_size[1] * 4) if manip: