From beb7fedb10b3bc3974fa07725d71c83aa9ad407e Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 30 May 2021 08:23:27 +0000 Subject: [PATCH] Fix (tests): Use random password to reduce server rate limiting causing failed tests This fixes false negatives (incorrect test failures). --- src/PSSourceQuery/public/GoldSourceRcon.Tests.ps1 | 2 +- src/PSSourceQuery/public/SourceRcon.Tests.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PSSourceQuery/public/GoldSourceRcon.Tests.ps1 b/src/PSSourceQuery/public/GoldSourceRcon.Tests.ps1 index 2efe17b..024c845 100644 --- a/src/PSSourceQuery/public/GoldSourceRcon.Tests.ps1 +++ b/src/PSSourceQuery/public/GoldSourceRcon.Tests.ps1 @@ -52,7 +52,7 @@ Describe "GoldSourceRcon" -Tag 'Unit' { } It 'Fails when rcon password is wrong' { - $password = 'foo' + $password = "$( Get-Random -Minimum 1 -Maximum 1000000 )" $command = 'status' $ErrorActionPreference = 'Stop' Mock Write-Verbose {} diff --git a/src/PSSourceQuery/public/SourceRcon.Tests.ps1 b/src/PSSourceQuery/public/SourceRcon.Tests.ps1 index ccafde7..71bc960 100644 --- a/src/PSSourceQuery/public/SourceRcon.Tests.ps1 +++ b/src/PSSourceQuery/public/SourceRcon.Tests.ps1 @@ -52,7 +52,7 @@ Describe "SourceRcon" -Tag 'Unit' { } It 'Fails when rcon password is wrong' { - $password = 'foo' + $password = "$( Get-Random -Minimum 1 -Maximum 1000000 )" $command = 'status' $ErrorActionPreference = 'Stop' Mock Write-Verbose {}