skip dockerised tests unless CI=1
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user