Skip to content

Fix(test): test on temporary directories#106

Merged
NTBBloodbath merged 3 commits into
norgolith:masterfrom
boltlessengineer:test-on-temp
May 14, 2025
Merged

Fix(test): test on temporary directories#106
NTBBloodbath merged 3 commits into
norgolith:masterfrom
boltlessengineer:test-on-temp

Conversation

@boltlessengineer

Copy link
Copy Markdown
Contributor

Testing on current directory can be affected with current directory state and can mess up current directory when test is failed.
For example, right now, running test twice fails on second attempt because my-site/ directory still persists in current directory.

Use tempfile crate to create temporary clean directories and automatically remove them ragardless of test failure.

Testing on current dir is not reproducible because it can be affected with
current directory content.
Test with absolute directories using `tempdir` crate
`cli` tests affect by `current_dir` anyways so run in serial using
`serial_test` crate. Also, use temporary directories instead of current
directory. This will prevent failed test to mess up with current
directory.

@NTBBloodbath NTBBloodbath left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@NTBBloodbath NTBBloodbath merged commit 094f1f4 into norgolith:master May 14, 2025
@boltlessengineer boltlessengineer deleted the test-on-temp branch May 14, 2025 19:36
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