Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure tests can't corrupt the environment #90

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

mbklein
Copy link
Contributor

@mbklein mbklein commented Jan 31, 2023

process.env = env made it so that any other tests in the same block that modified process.env were modifying the saved copy as well, causing knock-on effects.

I also changed how environment setup works to delete variables that exist by default in developer environments that do not exist in the test environment.

@mbklein mbklein temporarily deployed to test January 31, 2023 15:39 — with GitHub Actions Inactive
@mbklein mbklein force-pushed the restore-environment-properly branch from 369c10d to eef9f3d Compare January 31, 2023 15:45
@mbklein mbklein temporarily deployed to test January 31, 2023 15:45 — with GitHub Actions Inactive
@mbklein mbklein force-pushed the restore-environment-properly branch from eef9f3d to 18ebaf3 Compare January 31, 2023 15:46
@mbklein mbklein temporarily deployed to test January 31, 2023 15:46 — with GitHub Actions Inactive
@mbklein mbklein force-pushed the restore-environment-properly branch from 18ebaf3 to c289bd6 Compare January 31, 2023 15:49
@mbklein mbklein temporarily deployed to test January 31, 2023 15:49 — with GitHub Actions Inactive
@mbklein mbklein force-pushed the restore-environment-properly branch from c289bd6 to 24a677a Compare January 31, 2023 15:58
@mbklein mbklein temporarily deployed to test January 31, 2023 15:58 — with GitHub Actions Inactive
@mbklein mbklein changed the title Copy process.env when saving or restoring in tests Ensure tests can't corrupt the environment Jan 31, 2023
@mbklein mbklein merged commit de3c21d into deploy/staging Jan 31, 2023
@mbklein mbklein deleted the restore-environment-properly branch January 31, 2023 16:57
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.

3 participants