mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 22:44:24 +00:00
test/e2e: add random testnet generator (#5479)
Closes #5291. Adds a randomized testnet generator. Nightly CI job will be submitted separately. A few of the testnets can be a bit flaky, even after disabling known-faulty behavior and making minor tweaks, and the larger networks may be too resource-intensive to run in CI - this will be optimized separately.
This commit is contained in:
committed by
Erik Grinaker
parent
e7568f9e0c
commit
f9bfb40d53
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestCombinations(t *testing.T) {
|
||||
input := map[string][]interface{}{
|
||||
"bool": {false, true},
|
||||
"int": {1, 2, 3},
|
||||
"string": {"foo", "bar"},
|
||||
}
|
||||
|
||||
c := combinations(input)
|
||||
assert.Equal(t, []map[string]interface{}{
|
||||
{"bool": false, "int": 1, "string": "foo"},
|
||||
{"bool": false, "int": 1, "string": "bar"},
|
||||
{"bool": false, "int": 2, "string": "foo"},
|
||||
{"bool": false, "int": 2, "string": "bar"},
|
||||
{"bool": false, "int": 3, "string": "foo"},
|
||||
{"bool": false, "int": 3, "string": "bar"},
|
||||
{"bool": true, "int": 1, "string": "foo"},
|
||||
{"bool": true, "int": 1, "string": "bar"},
|
||||
{"bool": true, "int": 2, "string": "foo"},
|
||||
{"bool": true, "int": 2, "string": "bar"},
|
||||
{"bool": true, "int": 3, "string": "foo"},
|
||||
{"bool": true, "int": 3, "string": "bar"},
|
||||
}, c)
|
||||
}
|
||||
Reference in New Issue
Block a user