Skip to content

Commit

Permalink
Tests: Update triggers & better reservation name. (#157)
Browse files Browse the repository at this point in the history
* Add trigger when pushed to main.

* Add reservation name reflecting current GH job.

* ImageManipV2 fix for alpha11.
  • Loading branch information
kkeroo authored Jan 7, 2025
1 parent 5044caf commit b93f10f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/end_to_end/manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b93f10f

Please sign in to comment.