Changed test names in order to filter mainnet/testnet targets
This commit is contained in:
parent
9f425564ed
commit
acae88fcdc
@ -2,20 +2,20 @@ stages:
|
|||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
|
||||||
build:binary:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
tags:
|
tags:
|
||||||
- blockbook
|
- blockbook
|
||||||
script: make build
|
script: make build
|
||||||
|
|
||||||
test:unittest:
|
unit-test:
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
tags:
|
||||||
- blockbook
|
- blockbook
|
||||||
script: make test
|
script: make test
|
||||||
|
|
||||||
test:integration:
|
integration-test:
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
tags:
|
||||||
- blockbook
|
- blockbook
|
||||||
script: make test-integration ARGS="-run='TestIntegration/(bcash|bgold|bitcoin|dash|dogecoin|litecoin|vertcoin|zcash)/'"
|
script: make test-integration ARGS="-run='TestIntegration/(bcash|bgold|bitcoin|dash|dogecoin|litecoin|vertcoin|zcash)=main/'"
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/jakm/btcutil/chaincfg"
|
"github.com/jakm/btcutil/chaincfg"
|
||||||
@ -45,7 +46,8 @@ func runIntegrationTests(t *testing.T) {
|
|||||||
|
|
||||||
for _, coin := range keys {
|
for _, coin := range keys {
|
||||||
cfg := tests[coin]
|
cfg := tests[coin]
|
||||||
t.Run(coin, func(t *testing.T) { runTests(t, coin, cfg) })
|
name := getMatchableName(coin)
|
||||||
|
t.Run(name, func(t *testing.T) { runTests(t, coin, cfg) })
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,6 +62,14 @@ func loadTests(path string) (map[string]map[string]json.RawMessage, error) {
|
|||||||
return v, err
|
return v, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getMatchableName(coin string) string {
|
||||||
|
if idx := strings.Index(coin, "_testnet"); idx != -1 {
|
||||||
|
return coin[:idx] + "=test"
|
||||||
|
} else {
|
||||||
|
return coin + "=main"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func runTests(t *testing.T, coin string, cfg map[string]json.RawMessage) {
|
func runTests(t *testing.T, coin string, cfg map[string]json.RawMessage) {
|
||||||
if cfg == nil || len(cfg) == 0 {
|
if cfg == nil || len(cfg) == 0 {
|
||||||
t.Skip("No tests to run")
|
t.Skip("No tests to run")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user