-
Notifications
You must be signed in to change notification settings - Fork 1
feat!: add clean up test environments #25
base: main
Are you sure you want to change the base?
Conversation
Sorry - what I meant is: testUtils.cleanUp() This should clean up all things created during that test run. Test Environments |
Umm I will also add that 👍 I thought about adding a prefix to test environment deletion but decided to go for the regex. If I suppose a prefix I could break someones tests. I guess I could add it by default on env creation also so it is consistent |
b132df7
to
8fe58a8
Compare
e0f2112
to
f50b8e5
Compare
f50b8e5
to
873f705
Compare
BREAKING CHANGE: Updated node and packages versions, switched to plainClient, changed params for functions
@@ -50,12 +50,29 @@ const testSpace = await testUtils.createTestSpace({ | |||
|
|||
#### Create Test Environment | |||
Creates a test environment in the provided space and waits for it to be ready (timeout: 5 minutes). | |||
The length of the environment name must be less than 40 characters. | |||
The length of the environment name must be less than 40 characters and the environment will have prefixed a `%` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The length of the environment name must be less than 40 characters and the environment will have prefixed a `%` | |
The length of the environment name must be less than 40 characters and the environment name will have prefixed a `%` |
src/clean-up.ts
Outdated
export async function cleanUp(options: CleanUpSpacesOptions) { | ||
const client = options.client ?? initClient(); | ||
for (const space of options.spaces) { | ||
await cleanUpTestEnvironments({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this maybe first cleanup all test spaces, and then all test environments on the spaces that are still around? 🤔
a1723e0
to
b70003d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready to be released 🎉
Make sure you set the right commit message to force a new major version.
@damienxy any comments from your side?
BREAKING CHANGE: lot's of new changes
5d55d40
to
a28adb9
Compare
Hello!
I'm doing this PR because when I did the integration testing for a project I didn't take into account that sometimes environments get too long to get created and my tests timeout so now we have some environments that should be deleted.
Instead of adding it as a script in the tests I thought it would be useful for future contentful users to add it to this package.
I also updated some dependencies as dependabot doesn't seem to update them? I can remove that commit if we want to stick to the previous versions.