Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions test/environment/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
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<void> {
async function setupContainers(skipContainers?: boolean): Promise<void> {
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...')
Expand Down
2 changes: 1 addition & 1 deletion test/integration/collections/CollectionsRepository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Loading