Copilot Chat Tests #72
Workflow file for this run
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: Copilot Chat Tests | |
on: | |
workflow_dispatch: | |
merge_group: | |
branches: ["main"] | |
permissions: | |
contents: read | |
jobs: | |
test: | |
defaults: | |
run: | |
working-directory: webapp | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache-dependency-path: webapp/yarn.lock | |
cache: "yarn" | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Install dependencies | |
run: yarn install | |
- name: Install Playwright Browsers | |
run: yarn playwright install --with-deps | |
- name: Update AIService configuration | |
working-directory: webapi | |
env: | |
AzureOpenAI__ApiKey: ${{ secrets.AZUREOPENAI__APIKEY }} | |
AzureOpenAI__Endpoint: ${{ secrets.AZUREOPENAI__ENDPOINT }} | |
run: | | |
dotnet dev-certs https | |
dotnet user-secrets set "AIService:Key" "$AzureOpenAI__ApiKey" | |
dotnet user-secrets set "AIService:Endpoint" "$AzureOpenAI__Endpoint" | |
- name: Start service in background | |
working-directory: webapi | |
run: | | |
dotnet run > service-log.txt 2>&1 & | |
for attempt in {0..20}; do | |
jobs | |
echo 'Waiting for service to start...'; | |
if curl -k https://localhost:40443/healthz; then | |
echo; | |
echo 'Service started'; | |
break; | |
fi; | |
sleep 5; | |
done | |
- name: Run Playwright tests | |
env: | |
REACT_APP_BACKEND_URI: https://localhost:40443/ | |
REACT_APP_AAD_CLIENT_ID: ${{ secrets.COPILOT_CHAT_REACT_APP_AAD_CLIENT_ID }} | |
REACT_APP_AAD_AUTHORITY: https://login.microsoftonline.com/common | |
REACT_APP_TEST_USER_ACCOUNT1: ${{ secrets.COPILOT_CHAT_TEST_USER_ACCOUNT1 }} | |
REACT_APP_TEST_USER_ACCOUNT1_INITIALS: ${{ secrets.COPILOT_CHAT_TEST_USER_ACCOUNT1_INITIALS }} | |
REACT_APP_TEST_USER_ACCOUNT2: ${{ secrets.COPILOT_CHAT_TEST_USER_ACCOUNT2 }} | |
REACT_APP_TEST_USER_PASSWORD1: ${{ secrets.COPILOT_CHAT_TEST_USER_PASSWORD1 }} | |
REACT_APP_TEST_USER_PASSWORD2: ${{ secrets.COPILOT_CHAT_TEST_USER_PASSWORD2 }} | |
REACT_APP_TEST_JIRA_EMAIL: ${{ secrets.COPILOT_CHAT_TEST_JIRA_EMAIL }} | |
REACT_APP_TEST_JIRA_ACCESS_TOKEN: ${{ secrets.COPILOT_CHAT_TEST_JIRA_ACCESS_TOKEN }} | |
REACT_APP_TEST_JIRA_SERVER_URL: ${{ secrets.COPILOT_CHAT_TEST_JIRA_SERVER_URL }} | |
REACT_APP_TEST_GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REACT_APP_TEST_GITHUB_ACCOUNT_OWNER: ${{ secrets.COPILOT_CHAT_TEST_GITHUB_ACCOUNT_OWNER }} | |
REACT_APP_TEST_GITHUB_REPOSITORY_NAME: ${{ secrets.COPILOT_CHAT_TEST_GITHUB_REPOSITORY_NAME }} | |
run: yarn playwright test | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: webapp/playwright-report/ | |
retention-days: 30 | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: service-log | |
path: webapi/service-log.txt | |
retention-days: 30 |