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

Running unit tests changes wallet.db file committed into the repo #139

Closed
starius opened this issue Jun 3, 2024 · 1 comment · Fixed by #138
Closed

Running unit tests changes wallet.db file committed into the repo #139

starius opened this issue Jun 3, 2024 · 1 comment · Fixed by #138

Comments

@starius
Copy link
Contributor

starius commented Jun 3, 2024

Running make unit modifies file cmd/chantools/testdata/wallet.db:

$ make unit
...
$ git diff
diff --git a/cmd/chantools/testdata/wallet.db b/cmd/chantools/testdata/wallet.db
index 4317346..ceb8d63 100644
Binary files a/cmd/chantools/testdata/wallet.db and b/cmd/chantools/testdata/wallet.db differ

This results in unwanted updates of the file, unrelated to a change.

I propose to change the unit test to copy a file to temp directory first and to run the modifications needed for the test on the temp file.

@guggero
Copy link
Member

guggero commented Jun 4, 2024

Yeah, I'm aware of that unfortunate side effect. I usually just reverted the change before committing, which isn't great 😅

starius added a commit to starius/chantools that referenced this issue Jun 5, 2024
Copy a file to temp directory before opening it.

Fix lightninglabs#139
starius added a commit to starius/chantools that referenced this issue Jun 18, 2024
Copy a file to temp directory before opening it.

Fix lightninglabs#139
starius added a commit to starius/chantools that referenced this issue Jun 18, 2024
Copy a file to temp directory before opening it.

Fix lightninglabs#139
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 a pull request may close this issue.

2 participants