Skip to content

Commit

Permalink
Fix test username and password (microsoft#888)
Browse files Browse the repository at this point in the history
Fix test username and password

### Contribution Checklist
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
  • Loading branch information
glahaye authored Mar 22, 2024
1 parent 7d213ba commit b8b8556
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/copilot-run-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ jobs:
- name: Configure test environment
working-directory: integration-tests
env:
Username: ${{secrets.COPILOT_CHAT_TEST_USER_ACCOUNT1}}
Password: ${{secrets.COPILOT_CHAT_TEST_USER_PASSWORD1}}
TestUsername: ${{secrets.COPILOT_CHAT_TEST_USER_ACCOUNT1}}
TestPassword: ${{secrets.COPILOT_CHAT_TEST_USER_PASSWORD1}}
run: |
dotnet user-secrets set "BaseServerUrl" "https://${{inputs.BACKEND_HOST}}.azurewebsites.net/"
dotnet user-secrets set "Authority" "https://login.microsoftonline.com/${{vars.APPLICATION_TENANT_ID}}"
dotnet user-secrets set "ClientID" ${{vars.APPLICATION_CLIENT_ID}}
dotnet user-secrets set "Scopes" "openid, offline_access, profile, api://${{vars.BACKEND_CLIENT_ID}}/access_as_user"
# dotnet user-secrets set "Username" "$env:Username"
# dotnet user-secrets set "Password" "$env:Password"
# dotnet user-secrets set "TestUsername" "$env:TestUsername"
# dotnet user-secrets set "TestPassword" "$env:TestPassword"
- name: Run integration tests
run: dotnet test --logger trx
4 changes: 2 additions & 2 deletions integration-tests/ChatCopilotIntegrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public abstract class ChatCopilotIntegrationTest : IDisposable
protected const string BaseUrlSettingName = "BaseServerUrl";
protected const string ClientIdSettingName = "ClientID";
protected const string AuthoritySettingName = "Authority";
protected const string UsernameSettingName = "Username";
protected const string PasswordSettingName = "Password";
protected const string UsernameSettingName = "TestUsername";
protected const string PasswordSettingName = "TestPassword";
protected const string ScopesSettingName = "Scopes";

protected readonly HttpClient _httpClient;
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/testsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"BaseServerUrl": "https://localhost:40443/",
"ClientID": "YOUR_FRONTEND_CLIEND_ID",
"Authority": "https://login.microsoftonline.com/YOUR_TENANT_ID",
"Username": "YOUR_TEST_USERNAME", // Note that an environment variable with this name is usually set and will override this value!
"Password": "YOUR_TEST_PASSWORD", // Take care not to check your password in
"TestUsername": "YOUR_TEST_USERNAME",
"TestPassword": "YOUR_TEST_PASSWORD", // Take care not to check your password in
"Scopes": "openid, offline_access, profile, api://YOUR_BACKEND_CLIENT_ID/access_as_user"
}

0 comments on commit b8b8556

Please sign in to comment.