Skip to content

Commit

Permalink
Merge pull request #524 from roboflow/fix/broken_e2e_tests
Browse files Browse the repository at this point in the history
Fix the problem with e2e tests
  • Loading branch information
PawelPeczek-Roboflow authored Jul 12, 2024
2 parents f7698dd + 2b5ddac commit 614c813
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hosted_inference_e2e_test_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: 🦾 Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements/requirements.test.unit.txt -r requirements/requirements.test.integration.txt
python -m pip install -r requirements/requirements.test.unit.txt -r requirements/requirements.test.integration.txt -r requirements/requirements.sdk.http.txt
- name: 📝 E2E test of HOSTED INFERENCE at 🚨 PRODUCTION 🚨 🔥🔥🔥🔥
run:
SKIP_WARMUP=${{ github.event.inputs.skip_warmup }} HOSTED_PLATFORM_TESTS_API_KEY=${{ secrets.LOAD_TEST_PRODUCTION_API_KEY }} HOSTED_PLATFORM_TESTS_PROJECT=roboflow-platform pytest tests/inference/hosted_platform_tests/
2 changes: 1 addition & 1 deletion .github/workflows/hosted_inference_e2e_test_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: 🦾 Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements/requirements.test.unit.txt -r requirements/requirements.test.integration.txt
python -m pip install -r requirements/requirements.test.unit.txt -r requirements/requirements.test.integration.txt -r requirements/requirements.sdk.http.txt
- name: 📝 E2E test of HOSTED INFERENCE at 😎 STAGING 😎 🔥🔥🔥🔥
run:
SKIP_WARMUP=${{ github.event.inputs.skip_warmup }} HOSTED_PLATFORM_TESTS_API_KEY=${{ secrets.LOAD_TEST_STAGING_API_KEY }} HOSTED_PLATFORM_TESTS_PROJECT=roboflow-staging pytest tests/inference/hosted_platform_tests/
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
registries: ${{ secrets.PRODUCTION_AWS_ACCOUNT_ID }}
mask-password: "true" # see: https://github.com/aws-actions/amazon-ecr-login#docker-credentials
- name: 🛠️ Build and push docker image [SLIM] to PRODUCTION 🚨
if: ${{ !github.event.inputs.exclude_slim_lambda }}
if: ${{ github.event.inputs.exclude_slim_lambda == 'false' }}
run: |
./docker/publish/onnx_lambda.sh roboflow-platform slim
- name: 🛠️ Build and push docker image [CORE MODELS] to PRODUCTION 🚨
if: ${{ !github.event.inputs.exclude_core_models_lambda }}
if: ${{ github.event.inputs.exclude_core_models_lambda == 'false' }}
run: |
./docker/publish/onnx_lambda.sh roboflow-platform
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
registries: ${{ secrets.STAGING_AWS_ACCOUNT_ID }}
mask-password: "true" # see: https://github.com/aws-actions/amazon-ecr-login#docker-credentials
- name: 🛠️ Build and push docker image [SLIM] to STAGING 😎
if: ${{ !github.event.inputs.exclude_slim_lambda }}
if: ${{ github.event.inputs.exclude_slim_lambda == 'false' }}
run: |
./docker/publish/onnx_lambda.sh roboflow-staging slim
- name: 🛠️ Build and push docker image [CORE MODELS] to STAGING 😎
if: ${{ !github.event.inputs.exclude_core_models_lambda }}
if: ${{ github.event.inputs.exclude_core_models_lambda == 'false' }}
run: |
./docker/publish/onnx_lambda.sh roboflow-staging
23 changes: 21 additions & 2 deletions tests/inference/hosted_platform_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,39 @@
import os
from enum import Enum
from functools import partial
from typing import Any

import numpy as np
import pytest

from inference.core.utils.environment import str2bool
from inference_sdk import InferenceHTTPClient


def str2bool(value: Any) -> bool:
if isinstance(value, bool):
return value
if not issubclass(type(value), str):
raise ValueError(
f"Expected a boolean environment variable (true or false) but got '{value}'"
)
if value.lower() == "true":
return True
elif value.lower() == "false":
return False
else:
raise ValueError(
f"Expected a boolean environment variable (true or false) but got '{value}'"
)


MAXIMUM_CONSECUTIVE_INVOCATION_ERRORS = int(
os.getenv("HOSTED_PLATFORM_TESTS_MAX_WARMUP_CONSECUTIVE_ERRORS", 5)
)
MINIMUM_NUMBER_OF_SUCCESSFUL_RESPONSES = int(
os.getenv("HOSTED_PLATFORM_TESTS_MIN_WARMUP_SUCCESS_RESPONSES", 5)
)
SKIP_WARMUP = str2bool(os.getenv("SKIP_WARMUP", False))
IMAGE_URL = "https://media.roboflow.com/inference/dog.jpeg"


class PlatformEnvironment(Enum):
Expand Down Expand Up @@ -232,4 +251,4 @@ def retry_at_max_n_times(function: callable, n: int, function_description: str)
raise Exception(f"Could not achieve success of {function_description}")


IMAGE_URL = "https://media.roboflow.com/inference/dog.jpeg"

0 comments on commit 614c813

Please sign in to comment.