diff --git a/test/environment/setup.ts b/test/environment/setup.ts index 3126f8b1..bc46cc42 100644 --- a/test/environment/setup.ts +++ b/test/environment/setup.ts @@ -9,17 +9,20 @@ const CONTAINER_DATAVERSE_BOOTSTRAP_NAME = 'test_dataverse_bootstrap' const CONTAINER_DATAVERSE_BOOTSTRAP_END_MESSAGE = 'Done, your instance has been configured for development. Have a nice day!' const CONTAINERS_STARTUP_TIMEOUT = 300000 - +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 const API_ALLOW_TOKEN_LOOKUP_ENDPOINT = '/admin/settings/:AllowApiTokenLookupViaApi' const API_KEY_USER_ENDPOINT = '/builtin-users/dataverseAdmin/api-token' const API_KEY_USER_PASSWORD = 'admin1' export default async function setupTestEnvironment(): Promise { - await setupContainers() + await setupContainers(SKIP_CONTAINERS) //Set skipContainers to true to skip container setup and run tests against an already running instance await setupApiKey() } -async function setupContainers(): Promise { +async function setupContainers(skipContainers?: boolean): Promise { + if (skipContainers) { + return + } console.log('Cleaning up old container volumes...') fs.rmSync(`${__dirname}/docker-dev-volumes`, { recursive: true, force: true }) console.log('Running test containers...') diff --git a/test/integration/collections/CollectionsRepository.test.ts b/test/integration/collections/CollectionsRepository.test.ts index 94b62311..861a970e 100644 --- a/test/integration/collections/CollectionsRepository.test.ts +++ b/test/integration/collections/CollectionsRepository.test.ts @@ -997,7 +997,7 @@ describe('CollectionsRepository', () => { // TODO: uncomment this test when https://github.com/IQSS/dataverse/issues/12027 is fixed // const expectedDatasetCitationFragment = `Admin, Dataverse; Owner, Dataverse, ${currentYear}, "Dataset created using the createDataset use case` const expectedDatasetDescription = 'Dataset created using the createDataset use case' - const expectedFileName = 'test-file-4.tab' + const expectedFileName = 'test-file-4.tsv' const expectedCollectionsName = 'Scientific Research' expect(actualFilePreview.checksum?.type).toBe('MD5')