From 2a7ca2e6a23321572d9ec80c32c1c7d13ecd2d08 Mon Sep 17 00:00:00 2001 From: Alexey-Ayupov <116575425+Alexey-Ayupov@users.noreply.github.com> Date: Mon, 15 Jan 2024 11:57:43 +0100 Subject: [PATCH] [Ubuntu] Add predefined variable to skip test in the pipeline (#9153) --- images/ubuntu/scripts/tests/System.Tests.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images/ubuntu/scripts/tests/System.Tests.ps1 b/images/ubuntu/scripts/tests/System.Tests.ps1 index de18d6eaa..1abe55934 100644 --- a/images/ubuntu/scripts/tests/System.Tests.ps1 +++ b/images/ubuntu/scripts/tests/System.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Disk free space" { +# The $env:AGENT_NAME and $env:RUNNER_NAME are predefined variables for the ADO pipelines and for the GitHub actions respectively. +# If the test is running on the ADO pipeline or on the GitHub actions, the test will be skipped +Describe "Disk free space" -Skip:(-not [String]::IsNullOrEmpty($env:AGENT_NAME) -or -not [String]::IsNullOrEmpty($env:RUNNER_NAME)) { It "Image has more than 31GB free space" { $freeSpace = (Get-PSDrive "/").Free $freeSpace | Should -BeGreaterOrEqual 31GB