From 8e824d6544ed71222c58f9e209bcce60b27b9652 Mon Sep 17 00:00:00 2001 From: Otavio Macedo <288203+otaviomacedo@users.noreply.github.com> Date: Thu, 30 Jan 2025 14:50:35 +0000 Subject: [PATCH] chore: can skip tests during build by setting SKIP_TESTS=1 --- .projen/tasks.json | 3 ++- .projenrc.ts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.projen/tasks.json b/.projen/tasks.json index bf7bcb28c..487e4bc21 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -338,7 +338,8 @@ { "spawn": "eslint" } - ] + ], + "condition": "node -e \"if (process.env.SKIP_TESTS==='1') process.exit(1)\"" }, "test:watch": { "name": "test:watch", diff --git a/.projenrc.ts b/.projenrc.ts index 442be0d59..cd3423cc7 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -100,6 +100,11 @@ for (const lang of ['typescript', 'python', 'java']) { project.gitignore.exclude(output); } +// Allow skipping tests in build based on an env variable +// This is only used by the package integrity check running outside the repo +// While this check needs to replicate the release, it does not need to run tests +project.testTask.addCondition("node -e \"if (process.env.SKIP_TESTS==='1') process.exit(1)\""); + // Projen task to update references to old versions of cdk8s-plus const versionTaskObject = project.addTask('rotate'); versionTaskObject.exec('ts-node projenrc/rotate.ts ' + SPEC_VERSION);