Normalize case when checking for user email (#5240)

Reduce chance of test failures by normalizing the case prior to comparison. This should hopefully reduce spurious test failures.

---

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No

#### Type of change

- [ ] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [x] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Test Plan

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2024-02-20 14:45:21 -08:00 committed by GitHub
parent b9b5650506
commit f4dbaf60b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -151,7 +151,10 @@ func runExchangeBackupCategoryTest(suite *BackupExchangeE2ESuite, category path.
t.Log("backup results", result) t.Log("backup results", result)
// As an offhand check: the result should contain the m365 user's email. // As an offhand check: the result should contain the m365 user's email.
assert.Contains(t, result, suite.m365.User.Provider.Name()) assert.Contains(
t,
strings.ToLower(result),
strings.ToLower(suite.m365.User.Provider.Name()))
} }
func (suite *BackupExchangeE2ESuite) TestExchangeBackupCmd_ServiceNotEnabled_email() { func (suite *BackupExchangeE2ESuite) TestExchangeBackupCmd_ServiceNotEnabled_email() {
@ -184,7 +187,10 @@ func runExchangeBackupServiceNotEnabledTest(suite *BackupExchangeE2ESuite, categ
t.Log("backup results", result) t.Log("backup results", result)
// As an offhand check: the result should contain the m365 user's email. // As an offhand check: the result should contain the m365 user's email.
assert.Contains(t, result, suite.m365.User.Provider.Name()) assert.Contains(
t,
strings.ToLower(result),
strings.ToLower(suite.m365.User.Provider.Name()))
} }
func (suite *BackupExchangeE2ESuite) TestExchangeBackupCmd_userNotFound_email() { func (suite *BackupExchangeE2ESuite) TestExchangeBackupCmd_userNotFound_email() {
@ -283,7 +289,10 @@ func (suite *BackupExchangeE2ESuite) TestBackupCreateExchange_fromConfigFile() {
t.Log("backup results", result) t.Log("backup results", result)
// As an offhand check: the result should contain the m365 user's email. // As an offhand check: the result should contain the m365 user's email.
assert.Contains(t, result, suite.m365.User.Provider.Name()) assert.Contains(
t,
strings.ToLower(result),
strings.ToLower(suite.m365.User.Provider.Name()))
} }
// AWS flags // AWS flags