Skip to content

feat: add smoke tests and post-deploy workflow#213

Open
noahpodgurski wants to merge 4 commits into
mainfrom
smoke-tests
Open

feat: add smoke tests and post-deploy workflow#213
noahpodgurski wants to merge 4 commits into
mainfrom
smoke-tests

Conversation

@noahpodgurski

@noahpodgurski noahpodgurski commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

What's new

  • Updated linters_and_tests.yml to separate out the docs verification into separate steps and for running smoke tests.
  • Implemented smoke tests for App Attest QA, Play Integrity, FxA, SmartWindow, and Memories data flows. Each smoke test tests by local function invoking and remote deployments (Play Integrity testing path not yet finalized).
  • Updated dependencies in pyproject.toml and uv.lock to use the v0.9.2 of PyFxA-Oxide with CI_WAF_TOKEN changes, required for FxA testing.
  • Refactored app_attest_qa.py to remove unnecessary imports and improve payload handling.
  • Removed mock_response from classes, since LiteLLM doesn't seem to support that body parameter anymore.
  • Added mock_response as a separate model mock for testing and adjusted test assertions for consistency.
    https://mozilla-hub.atlassian.net/browse/AIPLAT-908

@noahpodgurski
noahpodgurski requested a review from a team as a code owner July 23, 2026 18:35
# ARGOCD_AUTH_TOKEN:
# required: true
# ARGOCD_SERVER:
# required: true

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add a TODO: here, or we can create another ticket for this. The idea is to hook the test job up to argo and have it check the sync status, and then fire off the remote smoke tests

# --grpc-web \
# --sync \
# --health \
# --timeout 900

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment above, this is some idea of how that integration might look

SMOKE_PLAY_INTEGRITY_TOKEN: ${{ secrets.SMOKE_PLAY_INTEGRITY_TOKEN }}
SMOKE_PLAY_INTEGRITY_USER_ID: ${{ secrets.SMOKE_PLAY_INTEGRITY_USER_ID }}
CI_WAF_TOKEN: ${{ secrets.CI_WAF_TOKEN }}
run: uv run pytest src/tests/smoke -v

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The smoke tests are ran in two forms essentially. It tests against the mocked_client_integration if SMOKE_BASE_URL is not set. If it is set, then it runs the tests against that deployment. App Attest, FxA, and Play Integrity auth are required. I've hooked up a test path for all except play integrity so far.

Comment thread src/mlpa/core/classes.py
temperature: Optional[float] = env.TEMPERATURE
max_completion_tokens: Optional[int] = env.MAX_COMPLETION_TOKENS
top_p: Optional[float] = env.TOP_P
mock_response: Optional[str] = None

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my testing, I couldn't get this parameter to work anymore, maybe it was an uptick in LiteLLM version that made it deprecated, but I only found success through setting a dedicated mock model through the litellm config

model_list:
  - model_name: mock
    litellm_params:
      model: openai/gpt-4o
      api_key: "mock-token"
      mock_response: "this is a mocked response"

mock_get_or_create_user,
mock_verify_assert,
mock_verify_attest,
from tests.fixtures import ( # noqa: F401

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These imports are required for the test fixtures, and the comment tells the linter to not complain about the unused imports

)

FXA_PASSWORD = "123dev123dev123dev"
FXA_CLIENT_ID = "5882386c6d801776"

@noahpodgurski noahpodgurski Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is our public stage FxA client ID which we use in a few places throughout MLPA


def _chat_payload() -> dict:
return {
"model": MOCK_MODEL_NAME,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MOCK_MODEL_NAME resolves to mock, which should be a configured mock model on the remote we're testing against (litellm configuration mentioned in comment above)

fi
mkdir -p "$RUNNER_TEMP/app-attest-qa"
printf '%s' "$SMOKE_APP_ATTEST_QA_CERT_B64" | base64 -d | tar -xz -C "$RUNNER_TEMP/app-attest-qa"
echo "APP_ATTEST_QA_CERT_DIR=$RUNNER_TEMP/app-attest-qa" >> "$GITHUB_ENV"

@noahpodgurski noahpodgurski Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This decodes the base64 encoded tar.gz cert bundle from SMOKE_APP_ATTEST_QA_CERT_B64,extracts the qa certs, and exports that dir in APP_ATTEST_QA_CERT_DIR for the smoke tests

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