Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

relocate, refactor, and write a few bats tests #593

Merged
merged 8 commits into from May 21, 2018
Merged

relocate, refactor, and write a few bats tests #593

merged 8 commits into from May 21, 2018

Conversation

whilei
Copy link
Contributor

@whilei whilei commented May 11, 2018

  • moves ./cmd/geth/*.bats to ./tests/bats/
    • update a few relative paths for fixture testdata
  • write api_eth.bats and api_personal.bats with the motivations:
    • explore the actual/expected/documentation behavior for eth_sign and it's counterpart personal_sign. https://github.com/ethereumproject/go-ethereum/wiki/JSON-RPC#eth_sign said that "Schoolbus" may be given as a data value to be signed, but in fact the value must be 0x-prefixed hex 0xabcd data. In this case, the documentation was wrong, and I just fixed it.
    • these test sets are not comprehensive, but intended to establish and suggest a pattern toward more thorough, less repetitive, and more descriptive bats tests

solution: move all bats test files to tests/bats
solution: change path to be absolute from GOPATH
solution: use GOPATH as absolute ref to testdata instead
solution: write eth_ and personal_ bats integration tests

yields:
- although documented that apparent arbitrary data can be provided
to be signed, in fact the data must be 0x-prefixed hex data (and not
'Schoolbus' as the documentation examples use. This behavior is
consistent between Classic and Foundation go-ethereums
solution: refactor for reusability and shared logic

- writes a few more personal_ api tests
solution: skip it instead, providing a message for why, too

- also refactors the tests a little to use the BATS tmp dir
…ld pass

solution: remove tests based on wrong documentation
solution: fix it.

- trimmed extra whitespace in appveyor config, too
@whilei whilei changed the title relocate, refactor, and write a few bats tests [WIP] relocate, refactor, and write a few bats tests May 15, 2018
@whilei whilei changed the title [WIP] relocate, refactor, and write a few bats tests relocate, refactor, and write a few bats tests May 21, 2018
@whilei whilei requested review from tzdybal and r8d8 May 21, 2018 13:10
@whilei whilei merged commit 81e6929 into master May 21, 2018
@soc1c soc1c deleted the tests/bats branch June 19, 2019 12:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants