(black-box) Testing #6
Replies: 8 comments 8 replies
-
Perhaps, using the Rust toolchain, a set of Integration tests can be written. These are calling an external process, which can be manually modified (in a config file?) to use a specific executable - ledger-cli or ledger-cli-rs. |
Beta Was this translation helpful? Give feedback.
-
Martin recommends checking ledger2beancount for its comprehensive test suite. Findings: |
Beta Was this translation helpful? Give feedback.
-
Ledger has a set of tests in https://github.com/ledger/ledger/tree/master/test
Findings so far: |
Beta Was this translation helpful? Give feedback.
-
I don't think you want a line for line exact output match to ledger, hledger, or beancount. You'll end up having / wanting your own interface. This will allow you to truly provide a reason to use this tool. What I believe you want is file format compatibility which I mentioned in #11. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
hledger tests use shelltestrunner, a tool inspired by Ledger's functional tests with a little more flexibility - might be of interest. Coincidentally I recently converted Ledgers func tests to shelltests. Thanks for mentioning ledger2beancount, I'll look at those also.
|
Beta Was this translation helpful? Give feedback.
-
https://github.com/simonmichael/hledger/tree/master/hledger/test/ledger-compat <https://github.com/simonmichael/hledger/tree/master/hledger/test/ledger-compat> > baseline, regress are a snapshot of Ledger's main func. tests with the actual tests commented out and replaced by a hledger read test.
And for completeness,
https://github.com/beancount/ledger2beancount/tree/master/tests <https://github.com/beancount/ledger2beancount/tree/master/tests> is ledger2beancount's test files.
|
Beta Was this translation helpful? Give feedback.
-
Updated the description and the tasks overview in the header post. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How to ensure full compatibility of the rewrite with the original Ledger?
A black-box testing tool is needed, to run the same set of tests on both executables.✅While creating a test harness, run on existing ledger with the test data files.
Goals
The most important group of tests would be Acceptance Tests.
Their purpose would be to:
Test Suite
The Acceptance test suite should use the sample set of journal files, run it through ledger and rledger (the new app) and assert that their output matches.
Cargo Test can be used as the test runner. Additional crates may help with this task.
A CLI testing suite can run any CLI application. => https://github.com/alensiljak/cli-test-executor was written for this purpose. It supports existing Ledger's test syntax.
Need to identify how to compare the output - identical output from both apps, or comparing the features through an output parser, API output comparison, etc.
Other
Additional resources/notes:
https://github.com/ledger-rs/incubator/wiki/Testing-Resources
To-Do
Beta Was this translation helpful? Give feedback.
All reactions