Skip to content

Commit

Permalink
Remove outdated tests (#18644)
Browse files Browse the repository at this point in the history
* Remove outdated unit tests

* Remove outdated validation method

* Remove unnecessary function calls

* Remove unnecessary references

* Remove unused localization for AzureFileCopyV1

* Remove unused localization for AzureFileCopyV2

* Remove unused localization for AzureFileCopyV3

* Remove unused localization for AzureFileCopyV4

* Remove unused localization for AzureFileCopyV5

* Bump WindowsMachineFileCopyV1 version

* Update localization for WindowsMachineFileCopyV2

* Remove old validation methods

* Update AzureFileCopyRemoteJob.ps1
  • Loading branch information
LeftTwixWand authored Jul 17, 2023
1 parent fd4597a commit 7d09b28
Show file tree
Hide file tree
Showing 103 changed files with 34 additions and 372 deletions.
1 change: 0 additions & 1 deletion Tasks/AzureFileCopyV1/AzureFileCopy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ try {
}

Check-ContainerNameAndArgs -containerName $containerName -additionalArguments $additionalArguments
Validate-AdditionalArguments $additionalArguments

# Uploading files to container
Upload-FilesToAzureContainer -sourcePath $sourcePath -storageAccountName $storageAccount -containerName $containerName -blobPrefix $blobPrefix -blobStorageEndpoint $blobStorageEndpoint -storageKey $storageKey `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
"loc.messages.AFC_RootContainerAndDirectory": "Die Option \"/S\" gilt nicht für \"$root\"-Container.",
"loc.messages.AFC_RedirectResponseInvalidStatusCode": "Der HTTP-Antwortcode \"{0}\" ist kein gültiger Umleitungsstatuscode.",
"loc.messages.AFC_RedirectResponseLocationHeaderIsNull": "Der Adressheader der Umleitungsantwort ist NULL.",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Deinstallieren Sie das benutzerdefinierte WinRM-Skript manuell, und wiederholen Sie die Bereitstellung.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Zusätzliche Argumente dürfen nicht die Trennzeichen „&“, „;“ und „|“ enthalten. Überprüfen Sie die Eingabe. Weitere Informationen zur Argumentüberprüfung finden Sie unter: https://aka.ms/azdo-task-argument-validation"
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Deinstallieren Sie das benutzerdefinierte WinRM-Skript manuell, und wiederholen Sie die Bereitstellung."
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
"loc.messages.AFC_RootContainerAndDirectory": "'/S' option is not valid for $root containers.",
"loc.messages.AFC_RedirectResponseInvalidStatusCode": "The HTTP response code: '{0}' is not a valid redirect status code",
"loc.messages.AFC_RedirectResponseLocationHeaderIsNull": "Redirect response location header is null.",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Uninstall WinRM custom script manually and retry deployment.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Additional arguments can't include separator characters '&', ';' and '|'. Please verify input. To learn more about argument validation, please check https://aka.ms/azdo-task-argument-validation"
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Uninstall WinRM custom script manually and retry deployment."
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
"loc.messages.AFC_RootContainerAndDirectory": "La opción \"/S\" no es válida para contenedores $root.",
"loc.messages.AFC_RedirectResponseInvalidStatusCode": "El código de respuesta HTTP \"{0}\" no es un código de estado de redireccionamiento válido.",
"loc.messages.AFC_RedirectResponseLocationHeaderIsNull": "El encabezado de ubicación de la respuesta de redireccionamiento es NULL.",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Desinstale el script personalizado de WinRM de forma manual y reintente la implementación.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Los argumentos adicionales no pueden incluir los caracteres separadores \"&\", \";\" y \"|\". Verifica la entrada. Para obtener más información sobre la validación de argumentos, consulta https://aka.ms/azdo-task-argument-validation"
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Desinstale el script personalizado de WinRM de forma manual y reintente la implementación."
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
"loc.messages.AFC_RootContainerAndDirectory": "L'option '/S' est non valide pour les conteneurs $root.",
"loc.messages.AFC_RedirectResponseInvalidStatusCode": "Le code de réponse HTTP '{0}' n'est pas un code d'état de redirection valide",
"loc.messages.AFC_RedirectResponseLocationHeaderIsNull": "L'en-tête d'emplacement pour la réponse de redirection a une valeur null.",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Désinstallez manuellement le script personnalisé WinRM, puis réessayez d'effectuer le déploiement.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Les arguments supplémentaires ne peuvent pas inclure les caractères de séparation '&', ';' and '|'. Veuillez vérifier l’entrée. Pour en savoir plus sur la validation des arguments, consultez https://aka.ms/azdo-task-argument-validation"
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Désinstallez manuellement le script personnalisé WinRM, puis réessayez d'effectuer le déploiement."
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
"loc.messages.AFC_RootContainerAndDirectory": "L'opzione '/S' non è valida per i contenitori $root.",
"loc.messages.AFC_RedirectResponseInvalidStatusCode": "Il codice di risposta HTTP '{0}' non è un codice di stato di reindirizzamento valido",
"loc.messages.AFC_RedirectResponseLocationHeaderIsNull": "Intestazione del percorso della risposta di reindirizzamento è Null.",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Disinstallare manualmente lo script personalizzato di WinRM e ripetere la distribuzione.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Gli argomenti aggiuntivi non possono includere caratteri separatori '&', ';' e '|'. Verifica l'input. Per altre informazioni sulla convalida degli argomenti, controllare https://aka.ms/azdo-task-argument-validation"
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Disinstallare manualmente lo script personalizzato di WinRM e ripetere la distribuzione."
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
"loc.messages.AFC_RootContainerAndDirectory": "$root コンテナーには、'/S' オプションは無効です。",
"loc.messages.AFC_RedirectResponseInvalidStatusCode": "HTTP 応答コード: '{0}' は無効なリダイレクト状態コードです",
"loc.messages.AFC_RedirectResponseLocationHeaderIsNull": "リダイレクト応答の場所ヘッダーが null です。",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "WinRM カスタム スクリプトを手動でアンインストールしてから、配置を再試行してください。",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "追加の引数に区切り文字 '&', ';', '|' を含めることはできません。入力を確認してください。引数の検証の詳細については、以下を確認してください: https://aka.ms/azdo-task-argument-validation"
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "WinRM カスタム スクリプトを手動でアンインストールしてから、配置を再試行してください。"
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
"loc.messages.AFC_RootContainerAndDirectory": "$root 컨테이너에 대해 '/S' 옵션이 잘못되었습니다.",
"loc.messages.AFC_RedirectResponseInvalidStatusCode": "HTTP 응답 코드: '{0}'은(는) 유효한 리디렉션 상태 코드가 아닙니다.",
"loc.messages.AFC_RedirectResponseLocationHeaderIsNull": "리디렉션 응답 위치 헤더가 null입니다.",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "WinRM 사용자 지정 스크립트를 수동으로 제거하고 배포를 다시 시도하세요.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "추가 인수에는 구분 문자 '&', ';', '|'을 포함할 수 없습니다. 입력 내용을 확인하세요. 인수 유효성 검사에 대한 자세한 내용은 https://aka.ms/azdo-task-argument-validation을 참조하세요."
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "WinRM 사용자 지정 스크립트를 수동으로 제거하고 배포를 다시 시도하세요."
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
"loc.messages.AFC_RootContainerAndDirectory": "Параметр \"/S\" является недопустимым для контейнеров $root.",
"loc.messages.AFC_RedirectResponseInvalidStatusCode": "Код ответа HTTP \"{0}\" не является допустимым кодом состояния перенаправления.",
"loc.messages.AFC_RedirectResponseLocationHeaderIsNull": "Заголовок расположения ответа перенаправления равен NULL.",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Удалите пользовательский скрипт WinRM вручную и повторите попытку развертывания.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Дополнительные аргументы не могут содержать разделители \"&\", \";\" и \"|\". Проверьте входные данные. Дополнительные сведения о проверке аргументов см. по адресу https://aka.ms/azdo-task-argument-validation"
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Удалите пользовательский скрипт WinRM вручную и повторите попытку развертывания."
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
"loc.messages.AFC_RootContainerAndDirectory": "\"/S\" 选项对 $root 容器无效。",
"loc.messages.AFC_RedirectResponseInvalidStatusCode": "HTTP 响应代码:“{0}”不是有效的重定向状态代码",
"loc.messages.AFC_RedirectResponseLocationHeaderIsNull": "重定向响应位置标头为 null。",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "请手动卸载 WinRM 自定义脚本,然后重试部署。",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "其他参数不能包含分隔符 '&', ';' 和 '|'.请验证输入。若要了解有关参数验证的详细信息,请检查 https://aka.ms/azdo-task-argument-validation"
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "请手动卸载 WinRM 自定义脚本,然后重试部署。"
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
"loc.messages.AFC_RootContainerAndDirectory": "'/S' 選項對 $root 容器而言無效。",
"loc.messages.AFC_RedirectResponseInvalidStatusCode": "HTTP 回應碼: '{0}' 不是有效的重新導向狀態碼",
"loc.messages.AFC_RedirectResponseLocationHeaderIsNull": "重新導向回應位置標頭為 null。",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "請手動將 WinRM 自訂指令碼解除安裝,並重試部署。",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "其他引數不能包含分隔字元 '&'、';' 和 '|'。請驗證輸入。若要深入了解引數驗證,請檢查 https://aka.ms/azdo-task-argument-validation"
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "請手動將 WinRM 自訂指令碼解除安裝,並重試部署。"
}
5 changes: 1 addition & 4 deletions Tasks/AzureFileCopyV1/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,5 @@ describe('AzureFileCopy Suite', function () {
it('Validate AzureFileCopy.Utility Check-ContainerNameAndArgs', (done) => {
psr.run(path.join(__dirname, 'L0CheckContainerNameAndArgs.ps1'), done);
});
it('Validate AzureFileCopy.Utility Validate-AdditionalArguments', (done) => {
psr.run(path.join(__dirname, 'L0ValidateAdditionalArguments.ps1'), done);
});
}
});
});
26 changes: 0 additions & 26 deletions Tasks/AzureFileCopyV1/Tests/L0ValidateAdditionalArguments.ps1

This file was deleted.

8 changes: 0 additions & 8 deletions Tasks/AzureFileCopyV1/Utility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1466,12 +1466,4 @@ function Check-ContainerNameAndArgs
{
Write-Warning (Get-vstsLocString -Key "AFC_RootContainerAndDirectory")
}
}

function Validate-AdditionalArguments([string]$additionalArguments)
{
if($additionalArguments -match "[&;|]")
{
ThrowError -errorMessage (Get-VstsLocString -Key "AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters")
}
}
5 changes: 2 additions & 3 deletions Tasks/AzureFileCopyV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 222,
"Minor": 225,
"Patch": 0
},
"demands": [
Expand Down Expand Up @@ -349,7 +349,6 @@
"AFC_RootContainerAndDirectory": "'/S' option is not valid for $root containers.",
"AFC_RedirectResponseInvalidStatusCode": "The HTTP response code: '{0}' is not a valid redirect status code",
"AFC_RedirectResponseLocationHeaderIsNull": "Redirect response location header is null.",
"AFC_UninstallWinRMCustomScriptExtension": "Uninstall WinRM custom script manually and retry deployment.",
"AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Additional arguments can't include separator characters '&', ';' and '|'. Please verify input. To learn more about argument validation, please check https://aka.ms/azdo-task-argument-validation"
"AFC_UninstallWinRMCustomScriptExtension": "Uninstall WinRM custom script manually and retry deployment."
}
}
5 changes: 2 additions & 3 deletions Tasks/AzureFileCopyV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 222,
"Minor": 225,
"Patch": 0
},
"demands": [
Expand Down Expand Up @@ -349,7 +349,6 @@
"AFC_RootContainerAndDirectory": "ms-resource:loc.messages.AFC_RootContainerAndDirectory",
"AFC_RedirectResponseInvalidStatusCode": "ms-resource:loc.messages.AFC_RedirectResponseInvalidStatusCode",
"AFC_RedirectResponseLocationHeaderIsNull": "ms-resource:loc.messages.AFC_RedirectResponseLocationHeaderIsNull",
"AFC_UninstallWinRMCustomScriptExtension": "ms-resource:loc.messages.AFC_UninstallWinRMCustomScriptExtension",
"AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "ms-resource:loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters"
"AFC_UninstallWinRMCustomScriptExtension": "ms-resource:loc.messages.AFC_UninstallWinRMCustomScriptExtension"
}
}
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV2/AzureFileCopy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Import-Module $PSScriptRoot\ps_modules\RemoteDeployer

# Initialize Azure.
Import-Module $PSScriptRoot\ps_modules\VstsAzureHelpers_

. "$PSScriptRoot\Utility.ps1"
$endpoint = Get-Endpoint -connectedServiceName $connectedServiceName
Update-PSModulePathForHostedAgentWithLatestModule -Endpoint $endpoint
Expand Down Expand Up @@ -169,7 +170,6 @@ try {
}

Check-ContainerNameAndArgs -containerName $containerName -additionalArguments $additionalArgumentsForBlobCopy
Validate-AdditionalArguments $additionalArguments

# Uploading files to container
Upload-FilesToAzureContainer -sourcePath $sourcePath `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,5 @@
"loc.messages.AFC_AzCopyBlobUploadNonZeroExitCode": "\"AzCopy.exe\" wurde mit einem Exitcode ungleich null beendet, während Dateien in den Blobspeicher hochgeladen wurden.",
"loc.messages.AFC_PreexecutionJob_UnableToGetStorageKey": "Der Speicherkontoschlüssel konnte nicht abgerufen werden. Fehler: {0}",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Deinstallieren Sie das benutzerdefinierte WinRM-Skript manuell, und wiederholen Sie die Bereitstellung.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Zusätzliche Argumente dürfen nicht die Trennzeichen „&“, „;“ und „|“ enthalten. Überprüfen Sie die Eingabe. Weitere Informationen zur Argumentüberprüfung finden Sie unter: https://aka.ms/azdo-task-argument-validation",
"loc.messages.ExpiredServicePrincipal": "Das Zugriffstoken für Azure konnte nicht abgerufen werden. Stellen Sie sicher, dass der verwendete Dienstprinzipal gültig und nicht abgelaufen ist."
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,5 @@
"loc.messages.AFC_AzCopyBlobUploadNonZeroExitCode": "AzCopy.exe exited with non-zero exit code while uploading files to blob storage.",
"loc.messages.AFC_PreexecutionJob_UnableToGetStorageKey": "Unable to fetch storage account key. Error: '{0}'",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Uninstall WinRM custom script manually and retry deployment.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Additional arguments can't include separator characters '&', ';' and '|'. Please verify input. To learn more about argument validation, please check https://aka.ms/azdo-task-argument-validation",
"loc.messages.ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired."
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,5 @@
"loc.messages.AFC_AzCopyBlobUploadNonZeroExitCode": "AzCopy.exe terminó con el código de salida distinto de cero al cargar archivos en el almacenamiento de blobs.",
"loc.messages.AFC_PreexecutionJob_UnableToGetStorageKey": "No se puede recuperar la clave de la cuenta de almacenamiento. Error: \"{0}\"",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Desinstale el script personalizado de WinRM de forma manual y reintente la implementación.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Los argumentos adicionales no pueden incluir los caracteres separadores \"&\", \";\" y \"|\". Verifica la entrada. Para obtener más información sobre la validación de argumentos, consulta https://aka.ms/azdo-task-argument-validation",
"loc.messages.ExpiredServicePrincipal": "No se pudo capturar el token de acceso de Azure. Compruebe que la entidad de servicio usada es válida y no ha expirado."
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,5 @@
"loc.messages.AFC_AzCopyBlobUploadNonZeroExitCode": "AzCopy.exe s'est arrêté avec un code de sortie différent de zéro durant le chargement des fichiers vers le Stockage Blob.",
"loc.messages.AFC_PreexecutionJob_UnableToGetStorageKey": "Impossible de récupérer (fetch) la clé du compte de stockage. Erreur : '{0}'",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Désinstallez manuellement le script personnalisé WinRM, puis réessayez d'effectuer le déploiement.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Les arguments supplémentaires ne peuvent pas inclure les caractères de séparation '&', ';' and '|'. Veuillez vérifier l’entrée. Pour en savoir plus sur la validation des arguments, consultez https://aka.ms/azdo-task-argument-validation",
"loc.messages.ExpiredServicePrincipal": "Impossible de récupérer (fetch) le jeton d'accès pour Azure. Vérifiez si le principal de service utilisé est valide et s'il n'a pas expiré."
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,5 @@
"loc.messages.AFC_AzCopyBlobUploadNonZeroExitCode": "AzCopy.exe è stato terminato con il codice di uscita diverso da zero durante il caricamento dei file nell'archivio BLOB.",
"loc.messages.AFC_PreexecutionJob_UnableToGetStorageKey": "Non è possibile recuperare la chiave dell'account di archiviazione. Errore: '{0}'",
"loc.messages.AFC_UninstallWinRMCustomScriptExtension": "Disinstallare manualmente lo script personalizzato di WinRM e ripetere la distribuzione.",
"loc.messages.AFC_AdditionalArgumentsMustNotIncludeForbiddenCharacters": "Gli argomenti aggiuntivi non possono includere caratteri separatori '&', ';' e '|'. Verifica l'input. Per altre informazioni sulla convalida degli argomenti, controllare https://aka.ms/azdo-task-argument-validation",
"loc.messages.ExpiredServicePrincipal": "Non è stato possibile recuperare il token di accesso per Azure. Verificare che l'entità servizio usata sia valida e non sia scaduta."
}
Loading

0 comments on commit 7d09b28

Please sign in to comment.