lightninglabs / chantools

A loose collection of tools all somehow related to lnd and Lightning Network channels.
MIT License
222 stars 32 forks source link

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

Closed starius closed 4 months ago

starius commented 4 months ago

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 commented 4 months ago

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