skip dockerised tests unless CI=1

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-06-08 14:44:41 +02:00
parent cfc705b120
commit 0711954a94
3 changed files with 19 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-test-utils': patch
---
Skip running docker tests unless in CI
@@ -56,7 +56,11 @@ export class TestDatabases {
disableDocker: isDockerDisabledForTests(),
};
const { ids, disableDocker } = Object.assign(defaultOptions, options ?? {});
const { ids, disableDocker } = Object.assign(
{},
defaultOptions,
options ?? {},
);
const supportedIds = ids.filter(id => {
const properties = allDatabases[id];
@@ -15,5 +15,13 @@
*/
export function isDockerDisabledForTests() {
return Boolean(process.env.BACKSTAGE_TEST_DISABLE_DOCKER);
// If we are not running in continuous integration, the default is to skip
// the (relatively heavy, long running) docker based tests. If you want to
// still run local tests for all databases, just pass either the CI=1 env
// parameter to your test runner, or individual connection strings per
// database.
return (
Boolean(process.env.BACKSTAGE_TEST_DISABLE_DOCKER) ||
!Boolean(process.env.CI)
);
}