Skip to content

Reb/integration tests start#41

Open
EugeneGene wants to merge 3 commits intomainfrom
reb/integration-tests-start
Open

Reb/integration tests start#41
EugeneGene wants to merge 3 commits intomainfrom
reb/integration-tests-start

Conversation

@EugeneGene
Copy link
Contributor

Summary

  • This PR is the starting framework for checking future PRs in a systematic and timely fashion.
  • The initial setup is based on pytest
  • Ideally, new features and fixes should be accompanied with new pytest files under ~/tests/integration/ and labeled with the prefix test_
tests
├── __init__.py
├── conftest.py
└── integration
    ├── __init__.py
    ├── data
    │   ├── __init__.py
    │   └── api_inference_models_and_inference.py
    ├── gateway.py
    ├── test_inference_models.py
    └── utils.py

Related Issue (optional)

How to test this PR?

Create a .env file in the root

  • Test cloud deployment by uncommenting the three lines following "Cloud Deployment (TEMPLATE)"
  • replace "API_KEY" with a real API_KEY
  • Test local deployment (tested using lima), by uncommenting the three lines following "Local Deployment (TEMPLATE)"
  • replace "API_KEY" with a real API_KEY created with your local deployment
# <<<<<<<< Gateway API Testing
# Cloud Deployment (TEMPLATE)
# BASE_GATEWAY_URL=https://geofm-gateway-geospatial.apps.fmaas-devstage-backend.fmaas.res.ibm.com
# GATEWAY_TLS_VERIFY=1   # 1: To Verify or 0: No Verify
# API_KEY=pak-01234567890123456789012345678901
#

# Local Deployment (TEMPLATE)
# BASE_GATEWAY_URL=https://localhost:4181
# GATEWAY_TLS_VERIFY=1   # 1: To Verify or 0: No Verify
# API_KEY=pak-01234567890123456789012345678901


# <<<<<<<< GEO Studio Developer (Should Edit)
# <<<<<<<< Gateway API Testing

Create a virtual python 3.11 (venv) development environment.

python3.11 -m venv venv-integration-tests-00 && source venv-integration-tests-00/bin/activate && pip install --upgrade pip && pip install -r requirements-dev.txt

Execute the single integration test

  • navigate to the root of the repo
  • execute the following:
cd /Users/reginaldbryant/src/oss/terrastackai/wt/reb-integration-tests-start
python -m pytest -q -m integration --no-cov \
--log-file=run.log --log-file-level=INFO \
tests/integration/test_inference_models.py 
  • this should yield
.........ssss                                                        [100%]
============================= warnings summary =============================
tests/integration/test_inference_models.py::test_create_model_fixture
tests/integration/test_inference_models.py::test_list_models_fixture
tests/integration/test_inference_models.py::test_deploy_model_with_amo_fixture_no_urls
tests/integration/test_inference_models.py::test_deploy_model_with_amo_fixture_no_urls_and_missing_model_id
tests/integration/test_inference_models.py::test_update_model_display_name
tests/integration/test_inference_models.py::test_update_model_display_name_for_missing_model_id
tests/integration/test_inference_models.py::test_get_model_
tests/integration/test_inference_models.py::test_get_model_with_nonexisting_model_id
tests/integration/test_inference_models.py::test_delete_model_create_then_delete
  /Users/reginaldbryant/src/oss/terrastackai/wt/reb-integration-tests-start/venv-integration-tests-00/lib/python3.11/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'geofm-gateway-geospatial.apps.fmaas-devstage-backend.fmaas.res.ibm.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
9 passed, 4 skipped, 9 warnings in 11.13s

Screenshots / Logs (optional)

Checklist

✅ This PR targets the main branch
❌ I have added or updated relevant docs.
✅ I have not included any secrets or credentials.
✅ Linting and formatting checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant