Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix Strategy for Tests #2

Merged
merged 11 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions .github/workflows/modelconverter_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,27 @@ permissions:
packages: read

env:
DOCKERFILE: docker/${{ inputs.package }}/Dockerfile
TAG: luxonis/modelconverter-${{ inputs.package }}:latest
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_ENDPOINT_URL: ${{ secrets.AWS_S3_ENDPOINT_URL }}
PACKAGE: ${{ inputs.package }}

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker
uses: crazy-max/ghaction-setup-docker@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -47,12 +57,12 @@ jobs:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
token_format: access_token

- name: Run Tests
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_ENDPOINT_URL: ${{ secrets.AWS_S3_ENDPOINT_URL }}
PACKAGE: ${{ inputs.package }}
- name: Run Tests (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
pytest -s --verbose "tests/test_packages/test_$PACKAGE.py"

- name: Run Tests (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
pytest -s --verbose "tests/test_packages/test_${{env.PACKAGE}}.py"
6 changes: 4 additions & 2 deletions modelconverter/packages/rvc4/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ def _adb_run(self, args, **kwargs) -> Tuple[int, str, str]:
f"stdout:\n{stdout}\n"
f"stderr:\n{stderr}\n"
)
return result.returncode, stdout.decode("utf-8"), stderr.decode(
"utf-8"
return (
result.returncode,
stdout.decode(errors="ignore"),
stderr.decode(errors="ignore"),
)

def shell(self, cmd: str) -> Tuple[int, str, str]:
Expand Down
4 changes: 2 additions & 2 deletions modelconverter/utils/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def subprocess_run(
if not silent:
log_message(info_string)
if result.stderr:
string = result.stderr.decode("utf-8")
string = result.stderr.decode(errors="ignore")
if not silent:
log_message(f"[ STDERR ]:\n{string}")
info_string += f"\n[ STDERR ]:\n{string}"
if result.stdout:
string = result.stdout.decode("utf-8")
string = result.stdout.decode(errors="ignore")
if not silent:
log_message(f"[ STDOUT ]:\n{string}")
info_string += f"\n[ STDOUT ]:\n{string}"
Expand Down
Loading