diff --git a/tests/CI/unittests.jenkinsfile b/tests/CI/unittests.jenkinsfile index 43774fd8fa..96ea2133bf 100644 --- a/tests/CI/unittests.jenkinsfile +++ b/tests/CI/unittests.jenkinsfile @@ -183,8 +183,10 @@ pipeline { } post { cleanup { - if (env.CLEANUP_WS_UNITTESTS.toBoolean()) { - cleanWs deleteDirs: true, notFailBuild: false + script { + if (env.CLEANUP_WS_UNITTESTS.toBoolean()) { + cleanWs deleteDirs: true, notFailBuild: false + } } } /*