Skip to content

Commit 197579b

Browse files
authored
Merge pull request #440 from IQSS/containers_skip
Setup TS change to allow skipping the containers setup.
2 parents ec54a6b + fe28886 commit 197579b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

test/environment/setup.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@ const CONTAINER_DATAVERSE_BOOTSTRAP_NAME = 'test_dataverse_bootstrap'
99
const CONTAINER_DATAVERSE_BOOTSTRAP_END_MESSAGE =
1010
'Done, your instance has been configured for development. Have a nice day!'
1111
const CONTAINERS_STARTUP_TIMEOUT = 300000
12-
12+
const SKIP_CONTAINERS = process.env.SKIP_CONTAINERS === 'true' // Set this environment variable to true to skip container setup and run tests against an already running instance
1313
const API_ALLOW_TOKEN_LOOKUP_ENDPOINT = '/admin/settings/:AllowApiTokenLookupViaApi'
1414
const API_KEY_USER_ENDPOINT = '/builtin-users/dataverseAdmin/api-token'
1515
const API_KEY_USER_PASSWORD = 'admin1'
1616

1717
export default async function setupTestEnvironment(): Promise<void> {
18-
await setupContainers()
18+
await setupContainers(SKIP_CONTAINERS) //Set skipContainers to true to skip container setup and run tests against an already running instance
1919
await setupApiKey()
2020
}
2121

22-
async function setupContainers(): Promise<void> {
22+
async function setupContainers(skipContainers?: boolean): Promise<void> {
23+
if (skipContainers) {
24+
return
25+
}
2326
console.log('Cleaning up old container volumes...')
2427
fs.rmSync(`${__dirname}/docker-dev-volumes`, { recursive: true, force: true })
2528
console.log('Running test containers...')

0 commit comments

Comments
 (0)