Replace hardcoded version with Version.java value

Bats version check tests now use a bash script for parsing
the value from the Bisq class file, and these test cases
no longer need to be manually updated.
This commit is contained in:
ghubstan 2020-09-22 14:45:21 -03:00
parent e3b3c625b3
commit 9132722bbf
No known key found for this signature in database
GPG key ID: E35592D6800A861E
2 changed files with 11 additions and 2 deletions

View file

@ -16,6 +16,8 @@
#
# ./cli/test.sh
# load 'mainnet-test-helper'
@test "test unsupported method error" {
run ./bisq-cli --password=xyz bogus
[ "$status" -eq 1 ]
@ -45,17 +47,19 @@
}
@test "test getversion call with quoted password" {
load 'version-parser'
run ./bisq-cli --password="xyz" getversion
[ "$status" -eq 0 ]
echo "actual output: $output" >&2
[ "$output" = "1.3.9" ]
[ "$output" = "$CURRENT_VERSION" ]
}
@test "test getversion" {
load 'version-parser'
run ./bisq-cli --password=xyz getversion
[ "$status" -eq 0 ]
echo "actual output: $output" >&2
[ "$output" = "1.3.9" ]
[ "$output" = "$CURRENT_VERSION" ]
}
@test "test setwalletpassword \"a b c\"" {

View file

@ -0,0 +1,5 @@
#!/bin/bash
# Bats helper script for parsing current version from Version.java.
export CURRENT_VERSION=$(grep "String VERSION =" common/src/main/java/bisq/common/app/Version.java | sed 's/[^0-9.]*//g')