From 216f4f2141f9a032dd1aaf9bc2b97d6ad04c50e4 Mon Sep 17 00:00:00 2001 From: Gil LaHaye Date: Thu, 21 Mar 2024 20:14:38 -0700 Subject: [PATCH] Fix test username and password (#888) 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 --- .github/workflows/copilot-run-integration-tests.yml | 8 ++++---- integration-tests/ChatCopilotIntegrationTest.cs | 4 ++-- integration-tests/testsettings.json | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/copilot-run-integration-tests.yml b/.github/workflows/copilot-run-integration-tests.yml index 627e5592e..9b00c4f87 100644 --- a/.github/workflows/copilot-run-integration-tests.yml +++ b/.github/workflows/copilot-run-integration-tests.yml @@ -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 diff --git a/integration-tests/ChatCopilotIntegrationTest.cs b/integration-tests/ChatCopilotIntegrationTest.cs index 91df3fdc4..84613fb95 100644 --- a/integration-tests/ChatCopilotIntegrationTest.cs +++ b/integration-tests/ChatCopilotIntegrationTest.cs @@ -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; diff --git a/integration-tests/testsettings.json b/integration-tests/testsettings.json index 310a2f526..2ec088ac6 100644 --- a/integration-tests/testsettings.json +++ b/integration-tests/testsettings.json @@ -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" }