[QA] VizroAI UI tests #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration tests for VizroAI UI | |
defaults: | |
run: | |
working-directory: vizro-ai | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: | |
- qa/component_library_tests | |
- main | |
paths: | |
- "vizro-ai/**" | |
- "!vizro-ai/docs/**" | |
env: | |
PYTHONUNBUFFERED: 1 | |
FORCE_COLOR: 1 | |
jobs: | |
test-vizro-ai-ui-fork: | |
if: ${{ github.event.pull_request.head.repo.fork }} | |
name: test-vizro-ai-ui | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Passed fork step | |
run: echo "Success!" | |
test-vizro-ai-ui: | |
if: ${{ ! github.event.pull_request.head.repo.fork }} | |
name: test-vizro-ai-ui | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install Hatch | |
run: pip install hatch | |
- name: Show dependency tree | |
run: hatch run tests:pip tree | |
- name: Run vizroAI UI tests | |
run: | | |
python examples/dashboard_ui/app.py & | |
tests/vizro_ai_ui/wait-for-it.sh 127.0.0.1:8050 -t 30 | |
hatch run tests:test-vizro-ai-ui | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }} | |
- name: Copy failed screenshots | |
if: failure() | |
run: | | |
mkdir /home/runner/work/vizro/vizro/vizro-ai/failed_screenshots/ | |
cp tests*.png failed_screenshots | |
- name: Archive screenshot artifacts | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: Failed screenshots | |
path: | | |
/home/runner/work/vizro/vizro/vizro-ai/failed_screenshots/*.png | |
- name: Send custom JSON data to Slack | |
id: slack | |
uses: slackapi/slack-github-action@v1.26.0 | |
if: failure() | |
with: | |
payload: | | |
{ | |
"text": "VizroAI UI tests build result: ${{ job.status }}\nBranch: ${{ github.head_ref }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |