Skip to content

chore: integration test keys#495

Open
Maya Karabuła-Stysiak (mayakarabula) wants to merge 9 commits intomainfrom
chore/integration-test-keys
Open

chore: integration test keys#495
Maya Karabuła-Stysiak (mayakarabula) wants to merge 9 commits intomainfrom
chore/integration-test-keys

Conversation

@mayakarabula
Copy link
Copy Markdown
Contributor

@mayakarabula Maya Karabuła-Stysiak (mayakarabula) commented Nov 2, 2023

integration test take a lot of time because we are generating new keys every time, we can just add and remove environments from one predefined key

import { ApiKey, Environment } from 'contentful-management'
import { CreateApiKeyProps, Space } from 'contentful-management/types'

export const INTEGRATION_TEST_KEY = '5HAbGYZ6iZWiDXGxMtvsrW'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name them something along the line of "access key id"?

try {
cdaTokenWithOnlyMasterAccess = await testSpace.getApiKey(INTEGRATION_TEST_KEY_MASTER)
} catch (e) {
cdaTokenWithOnlyMasterAccess = await createCdaToken(testSpace, ['master'])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what case would we end up in the catch clause?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the key is not found, for example, if it was removed

@marcolink
Copy link
Copy Markdown
Member

Love it - thank you! 🎉

@marcolink
Copy link
Copy Markdown
Member

Maya Karabuła-Stysiak (@mayakarabula) Should we merge it? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants