hledger-flow fails path tests on windows systems
mwesten opened this issue · 0 comments
Describe the bug
When building hledger-flow in a Windows (Windows10) system, the executable is built correctly, but the tests fail, because of the path-separator. The included tests expect a unix path separtor /
while the system returns the Windows path separator \
.
This is only a thing in the tests; the code itself checks for the path-separator.
Installing and running the hledger-app and importing data works as expected
Version and Runtime Information
$ hledger-flow --version
hledger-flow 0.13.2.0 mingw32 x86_64 ghc 8.8
This is the last git version I'm running (just updated)
$ hledger-flow --show-options import
RuntimeOptions {baseDir = FilePath "C:\\Users\\max\\source\\hledger-flow-example\\", importRunDir = FilePath ".\\", useRunDir = False, hfVersion = "hledger-flow 0.13.2.0 mingw32 x86_64 ghc 8.8", hledgerInfo = HledgerInfo {hlPath = FilePath "C:\\Users\\max\\AppData\\Roaming\\local\\bin\\hledger.exe", hlVersion = "hledger 1.17.1.1"}, sysInfo = SystemInfo {os = "mingw32", arch = "x86_64", compilerName = "ghc", compilerVersion = Version {versionBranch = [8,8], versionTags = []}}, verbose = False, showOptions = True, sequential = False}
Collecting input files from C:\Users\max\source\hledger-flow-example\import\
Found 3 input files in 0.0079695s. Proceeding with import...
hledger-flow: C:\Users\max\source\hledger-flow-example\import\gawie\bogart\cheque\preprocess: createProcess: invalid argument (Exec format error)
To Reproduce
Can you reproduce your issue on these example files?
I was using the example files when running the --show-options import
command above.
Steps to reproduce the behavior:
- Download the code per instructions on the contributing guidelines
- Then ran the command
stack test --interleaved-output --pedantic
- And got the following test error:
Registering library for hledger-flow-0.13.2.0..
hledger-flow> test (suite: hledger-flow-test)
### Failure in: 1:0
test\Common\Integration.hs:94
determineBaseDir produces an error message when given a non-existant dir
expected: Left "The provided directory does not exist: /path/to/dir"
but got: Left "The provided directory does not exist: \\path\\to\\dir"
### Failure in: 2:7
test\CSVImport\Unit.hs:424
Convert a grouped map of paths, to a map with text contents for each file
expected: fromList [(FilePath ".\\import\\john\\bogartbank\\checking\\2018-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include import/john/bogartbank/checking/3-journal/2018/2018-10-30.journal\n!include import/john/bogartbank/checking/3-journal/2018/2018-11-30.journal\n!include import/john/bogartbank/checking/3-journal/2018/2018-12-30.journal\n"),(FilePath ".\\import\\john\\bogartbank\\checking\\2019-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include import/john/bogartbank/checking/3-journal/2019/2019-01-30.journal\n!include import/john/bogartbank/checking/3-journal/2019/2019-02-30.journal\n"),(FilePath ".\\import\\john\\bogartbank\\savings\\2017-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include import/john/bogartbank/savings/3-journal/2017/2017-11-30.journal\n!include import/john/bogartbank/savings/3-journal/2017/2017-12-30.journal\n"),(FilePath ".\\import\\john\\bogartbank\\savings\\2018-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include import/john/bogartbank/savings/3-journal/2018/2018-01-30.journal\n!include import/john/bogartbank/savings/3-journal/2018/2018-02-30.journal\n")]
but got: fromList [(FilePath ".\\import\\john\\bogartbank\\checking\\2018-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include import\\john\\bogartbank\\checking\\3-journal\\2018\\2018-10-30.journal\n!include import\\john\\bogartbank\\checking\\3-journal\\2018\\2018-11-30.journal\n!include import\\john\\bogartbank\\checking\\3-journal\\2018\\2018-12-30.journal\n"),(FilePath ".\\import\\john\\bogartbank\\checking\\2019-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include import\\john\\bogartbank\\checking\\3-journal\\2019\\2019-01-30.journal\n!include import\\john\\bogartbank\\checking\\3-journal\\2019\\2019-02-30.journal\n"),(FilePath ".\\import\\john\\bogartbank\\savings\\2017-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include import\\john\\bogartbank\\savings\\3-journal\\2017\\2017-11-30.journal\n!include import\\john\\bogartbank\\savings\\3-journal\\2017\\2017-12-30.journal\n"),(FilePath ".\\import\\john\\bogartbank\\savings\\2018-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include import\\john\\bogartbank\\savings\\3-journal\\2018\\2018-01-30.journal\n!include import\\john\\bogartbank\\savings\\3-journal\\2018\\2018-02-30.journal\n")]
### Failure in: 3:2
test\CSVImport\Integration.hs:95
All pre/post files on disk should be included
expected: fromList [(FilePath ".\\hlflow-1e1497e36b7682f9\\import\\john\\2019-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include _manual_/2019/pre-import.journal\n!include bank1/2019-include.journal\n!include bank2/2019-include.journal\n!include _manual_/2019/post-import.journal\n")]
but got: fromList [(FilePath ".\\hlflow-1e1497e36b7682f9\\import\\john\\2019-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include _manual_\\2019\\pre-import.journal\n!include bank1\\2019-include.journal\n!include bank2\\2019-include.journal\n!include _manual_\\2019\\post-import.journal\n")]
### Failure in: 3:3
test\CSVImport\Integration.hs:119
All opening/closing files on disk should be included
expected: fromList [(FilePath ".\\hlflow-c14016fa77f9a37e\\import\\john\\bank1\\savings\\2019-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include 2019-opening.journal\n!include 3-journal/2019/2019-01-30.journal\n!include 2019-closing.journal\n")]
but got: fromList [(FilePath ".\\hlflow-c14016fa77f9a37e\\import\\john\\bank1\\savings\\2019-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include 2019-opening.journal\n!include 3-journal\\2019\\2019-01-30.journal\n!include 2019-closing.journal\n")]
### Failure in: 3:4
test\CSVImport\Integration.hs:144
The price file should be included together with any pre/post files
expected: fromList [(FilePath ".\\hlflow-72de84936923ac78\\import\\2020-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include _manual_/2020/pre-import.journal\n!include john/2020-include.journal\n!include ../prices/2020/prices.journal\n!include _manual_/2020/post-import.journal\n")]
but got: fromList [(FilePath ".\\hlflow-72de84936923ac78\\import\\2020-include.journal","### Generated by hledger-flow - DO NOT EDIT ###\n\n!include _manual_\\2020\\pre-import.journal\n!include john\\2020-include.journal\n!include ..\\prices\\2020\\prices.journal\n!include _manual_\\2020\\post-import.journal\n")]
### Failure in: 3:5
test\CSVImport\Integration.hs:198
John1: The include file contents should be the journal files
expected: "### Generated by hledger-flow - DO NOT EDIT ###\n\n!include 3-journal/2018/2018-10-30.journal\n!include 3-journal/2018/2018-11-30.journal\n!include 3-journal/2018/2018-12-30.journal\n"
but got: "### Generated by hledger-flow - DO NOT EDIT ###\n\n!include 3-journal\\2018\\2018-10-30.journal\n!include 3-journal\\2018\\2018-11-30.journal\n!include 3-journal\\2018\\2018-12-30.journal\n"
Cases: 20 Tried: 20 Errors: 0 Failures: 6
hledger-flow> Test suite hledger-flow-test failed
Completed 2 action(s).
Test suite failure for package hledger-flow-0.13.2.0
hledger-flow-test: exited with: ExitFailure 1
Logs printed to console
Expected behavior
Pass the test
Desktop (please complete the following information):
- OS: Windows10 Pro
- Version 1909
Additional context
Add any other context about the problem here.