Skip to content

Commit

Permalink
Add non prod environments to smoke tests, replacing dev
Browse files Browse the repository at this point in the history
  • Loading branch information
LeiGlobus committed Jan 11, 2024
1 parent 22f6de1 commit cdb7b2f
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 20 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
TARGET_PYTHON_VERSION: '3.11'

jobs:
smoke-test-dev:
smoke-test-staging:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
Expand All @@ -23,14 +23,14 @@ jobs:
python -m venv .venv
.venv/bin/python -m pip install --upgrade pip setuptools wheel
.venv/bin/python -m pip install tox
- name: run smoke tests (dev)
- name: run smoke tests (ECS staging)
env:
FUNCX_SMOKE_CLIENT_ID: ${{ secrets.API_CLIENT_ID }}
FUNCX_SMOKE_CLIENT_SECRET: ${{ secrets.API_CLIENT_SECRET }}
run: |
source .venv/bin/activate
cd smoke_tests
make dev
make staging
safety-check-sdk:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:

slack-notify:
needs:
- smoke-test-dev
- smoke-test-staging
- safety-check-sdk
- safety-check-endpoint
if: always()
Expand All @@ -87,6 +87,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_CHANNEL: '#commits'
SLACK_MESSAGE_TITLE: 'Daily Smoke Tests'
SLACK_FAILURE_MESSAGE: 'Daily test failed'
run: ./.github/_support/github-slack-notify.py ${{ needs.smoke-test-dev.result }}
SLACK_MESSAGE_TITLE: 'Daily Smoke Tests on Staging'
SLACK_FAILURE_MESSAGE: 'Daily test failed on staging'
run: ./.github/_support/github-slack-notify.py ${{ needs.smoke-test-staging.result }}
14 changes: 11 additions & 3 deletions smoke_tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@
# and optionally:
# $ export COMPUTE_LOCAL_KNOWN_FUNCTION_ID=<id_of_function_in_your_local_setup>

.PHONY: prod dev local
.PHONY: prod staging test sandbox preview integration local
prod:
tox
dev:
tox -e localdeps -- --compute-config dev
staging:
tox -e localdeps -- --compute-config staging
test:
tox -e localdeps -- --compute-config test
sandbox:
tox -e localdeps -- --compute-config sandbox
preview:
tox -e localdeps -- --compute-config preview
integration:
tox -e localdeps -- --compute-config integration
local_with_dev_sdk:
@if [ -z "${COMPUTE_LOCAL_ENDPOINT_ID}" ]; then echo "Missing exported COMPUTE_LOCAL_ENDPOINT_ID"; exit 1; fi
tox -e localdeps -- --compute-config local
Expand Down
8 changes: 4 additions & 4 deletions smoke_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ To run tests on prod:

make prod

To run tests on dev:
To run tests on ECS staging:

make dev
make staging

To run using local dependency versions (install SDK and endpoint from the
repo):

tox -e localdeps

You can also run `localdeps` against dev with
You can also run `localdeps` against ECS staging with

tox -e localdeps -- --compute-config dev
tox -e localdeps -- --compute-config staging

One can also run tests against a local webservice setup. Use the make targets
`local_with_published_sdk` and `local_with_dev_sdk` to run tests with published
Expand Down
38 changes: 32 additions & 6 deletions smoke_tests/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,40 @@
_LOCAL_FUNCTION_ID = os.getenv("COMPUTE_LOCAL_KNOWN_FUNCTION_ID")

_CONFIGS = {
"dev": {
"client_args": {"environment": "dev"},
# assert versions are as expected on dev
"test": {
"client_args": {"environment": "test"},
"forwarder_min_version": "0.3.5",
"api_min_version": "0.3.5",
# This fn is public
"public_hello_fn_uuid": "f84351f9-6f82-45d8-8eca-80d8f73645be",
"endpoint_uuid": "2238617a-8756-4030-a8ab-44ffb1446092",
"public_hello_fn_uuid": "232966fe-0b32-4434-8cd0-0ca217f8173c",
"endpoint_uuid": "4b116d3c-1703-4f8f-9f6f-39921e5864df",
},
"sandbox": {
"client_args": {"environment": "sandbox"},
"forwarder_min_version": "0.3.5",
"api_min_version": "0.3.5",
"public_hello_fn_uuid": "3bf4b413-d288-46b7-9808-0cad38db7dec",
"endpoint_uuid": "4b116d3c-1703-4f8f-9f6f-39921e5864df",
},
"preview": {
"client_args": {"environment": "preview"},
"forwarder_min_version": "0.3.5",
"api_min_version": "0.3.5",
"public_hello_fn_uuid": "566dfa52-4938-4c01-b6f5-eba4cb9898aa",
"endpoint_uuid": "4b116d3c-1703-4f8f-9f6f-39921e5864df",
},
"integration": {
"client_args": {"environment": "integration"},
"forwarder_min_version": "0.3.5",
"api_min_version": "0.3.5",
"public_hello_fn_uuid": "9815b262-b51c-48d5-8687-712f9616b9f1",
"endpoint_uuid": "4b116d3c-1703-4f8f-9f6f-39921e5864df",
},
"staging": {
"client_args": {"environment": "staging"},
"forwarder_min_version": "0.3.5",
"api_min_version": "0.3.5",
"public_hello_fn_uuid": "1e840c9d-1ff2-4e45-bf09-248f717df584",
"endpoint_uuid": "4b116d3c-1703-4f8f-9f6f-39921e5864df",
},
"prod": {
# By default tests are against production, which means we do not need to pass
Expand Down
4 changes: 4 additions & 0 deletions smoke_tests/tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
from packaging.version import Version


Expand Down Expand Up @@ -30,6 +31,9 @@ def test_simple_function(compute_client):
assert func_uuid is not None, "Invalid function uuid returned"


@pytest.mark.skip(
"Skipping as of 2024-01-11 while we wait for MU tutorial to show as 'online'"
)
def test_ep_status(compute_client, endpoint):
"""Test whether the tutorial EP is online and reporting status"""
response = compute_client.get_endpoint_status(endpoint)
Expand Down

0 comments on commit cdb7b2f

Please sign in to comment.