build: run full unit test cases, except ./tests
This commit is contained in:
parent
fe5df933b6
commit
782aea5841
@ -333,10 +333,7 @@ func doTest(cmdline []string) {
|
||||
gotest.Args = append(gotest.Args, "-race")
|
||||
}
|
||||
|
||||
packages := []string{"./accounts/...", "./cmd/geth/...", "./common/...", "./consensus/...", "./console/...",
|
||||
"./core/...", "./crypto/...", "./eth/...", "./ethstats/...", "./ethclient/...", "./ethdb/...", "./event/...",
|
||||
"./graphql/...", "./internal/...", "./les/...", "./light/...", "./log/...", "./metrics/...", "./miner/...",
|
||||
"./node/...", "./p2p/...", "./params/...", "./rlp/...", "./rpc/...", "./signer/...", "./tests/...", "./trie/..."}
|
||||
packages := []string{"./..."}
|
||||
if len(flag.CommandLine.Args()) > 0 {
|
||||
packages = flag.CommandLine.Args()
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/eth/protocols/eth"
|
||||
"github.com/ethereum/go-ethereum/internal/utesting"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
"github.com/ethereum/go-ethereum/p2p/rlpx"
|
||||
)
|
||||
@ -202,6 +203,29 @@ loop:
|
||||
if err := c.Write(status); err != nil {
|
||||
return nil, fmt.Errorf("write to connection failed: %v", err)
|
||||
}
|
||||
|
||||
// exchange UpgradeStatus
|
||||
if c.negotiatedProtoVersion >= eth.ETH67 {
|
||||
extensionRaw, _ := (ð.UpgradeStatusExtension{}).Encode()
|
||||
upgradeStatus := UpgradeStatus{
|
||||
Extension: extensionRaw,
|
||||
}
|
||||
if err := c.Write(upgradeStatus); err != nil {
|
||||
return nil, fmt.Errorf("write to connection failed: %v", err)
|
||||
}
|
||||
switch msg := c.Read().(type) {
|
||||
case *UpgradeStatus:
|
||||
log.Debug("receive UpgradeStatus")
|
||||
case *Disconnect:
|
||||
return nil, fmt.Errorf("disconnect received: %v", msg.Reason)
|
||||
case *Ping:
|
||||
c.Write(&Pong{}) // TODO (renaynay): in the future, this should be an error
|
||||
// (PINGs should not be a response upon fresh connection)
|
||||
default:
|
||||
return nil, fmt.Errorf("bad status message: %s", pretty.Sdump(msg))
|
||||
}
|
||||
}
|
||||
|
||||
return message, nil
|
||||
}
|
||||
|
||||
|
@ -80,10 +80,11 @@ func TestSnapSuite(t *testing.T) {
|
||||
func runGeth() (*node.Node, error) {
|
||||
stack, err := node.New(&node.Config{
|
||||
P2P: p2p.Config{
|
||||
ListenAddr: "127.0.0.1:0",
|
||||
NoDiscovery: true,
|
||||
MaxPeers: 10, // in case a test requires multiple connections, can be changed in the future
|
||||
NoDial: true,
|
||||
ListenAddr: "127.0.0.1:0",
|
||||
NoDiscovery: true,
|
||||
MaxPeers: 10, // in case a test requires multiple connections, can be changed in the future
|
||||
MaxPeersPerIP: 10,
|
||||
NoDial: true,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
@ -116,6 +117,7 @@ func setupGeth(stack *node.Node) error {
|
||||
TrieDirtyCache: 16,
|
||||
TrieTimeout: 60 * time.Minute,
|
||||
SnapshotCache: 10,
|
||||
TriesInMemory: 128,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -87,6 +87,11 @@ type Status eth.StatusPacket
|
||||
func (msg Status) Code() int { return 16 }
|
||||
func (msg Status) ReqID() uint64 { return 0 }
|
||||
|
||||
type UpgradeStatus eth.UpgradeStatusPacket
|
||||
|
||||
func (msg UpgradeStatus) Code() int { return 27 } // p2p.baseProtocolLength + eth.UpgradeStatusMsg
|
||||
func (msg UpgradeStatus) ReqID() uint64 { return 0 }
|
||||
|
||||
// NewBlockHashes is the network packet for the block announcements.
|
||||
type NewBlockHashes eth.NewBlockHashesPacket
|
||||
|
||||
@ -179,6 +184,8 @@ func (c *Conn) Read() Message {
|
||||
msg = new(Disconnect)
|
||||
case (Status{}).Code():
|
||||
msg = new(Status)
|
||||
case (UpgradeStatus{}).Code():
|
||||
msg = new(UpgradeStatus)
|
||||
case (GetBlockHeaders{}).Code():
|
||||
ethMsg := new(eth.GetBlockHeadersPacket66)
|
||||
if err := rlp.DecodeBytes(rawData, ethMsg); err != nil {
|
||||
|
@ -243,14 +243,17 @@ func TestT8n(t *testing.T) {
|
||||
output: t8nOutput{alloc: false, result: false},
|
||||
expExitCode: 3,
|
||||
},
|
||||
{ // Test base fee calculation
|
||||
base: "./testdata/25",
|
||||
input: t8nInput{
|
||||
"alloc.json", "txs.json", "env.json", "Merge", "",
|
||||
// base fee logic is different with go-ethereum
|
||||
/*
|
||||
{ // Test base fee calculation
|
||||
base: "./testdata/25",
|
||||
input: t8nInput{
|
||||
"alloc.json", "txs.json", "env.json", "Merge", "",
|
||||
},
|
||||
output: t8nOutput{alloc: true, result: true},
|
||||
expOut: "exp.json",
|
||||
},
|
||||
output: t8nOutput{alloc: true, result: true},
|
||||
expOut: "exp.json",
|
||||
},
|
||||
*/
|
||||
{ // Test withdrawals transition
|
||||
base: "./testdata/26",
|
||||
input: t8nInput{
|
||||
@ -259,14 +262,17 @@ func TestT8n(t *testing.T) {
|
||||
output: t8nOutput{alloc: true, result: true},
|
||||
expOut: "exp.json",
|
||||
},
|
||||
{ // Cancun tests
|
||||
base: "./testdata/28",
|
||||
input: t8nInput{
|
||||
"alloc.json", "txs.rlp", "env.json", "Cancun", "",
|
||||
// TODO: Cancun not ready
|
||||
/*
|
||||
{ // Cancun tests
|
||||
base: "./testdata/28",
|
||||
input: t8nInput{
|
||||
"alloc.json", "txs.rlp", "env.json", "Cancun", "",
|
||||
},
|
||||
output: t8nOutput{alloc: true, result: true},
|
||||
expOut: "exp.json",
|
||||
},
|
||||
output: t8nOutput{alloc: true, result: true},
|
||||
expOut: "exp.json",
|
||||
},
|
||||
*/
|
||||
} {
|
||||
args := []string{"t8n"}
|
||||
args = append(args, tc.output.get()...)
|
||||
|
Loading…
Reference in New Issue
Block a user