build: run full unit test cases, except ./tests

This commit is contained in:
NathanBSC 2023-09-13 11:46:47 +08:00 committed by buddho
parent fe5df933b6
commit 782aea5841
5 changed files with 58 additions and 22 deletions

@ -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, _ := (&eth.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
}

@ -83,6 +83,7 @@ func runGeth() (*node.Node, error) {
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,
},
})
@ -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,6 +243,8 @@ func TestT8n(t *testing.T) {
output: t8nOutput{alloc: false, result: false},
expExitCode: 3,
},
// base fee logic is different with go-ethereum
/*
{ // Test base fee calculation
base: "./testdata/25",
input: t8nInput{
@ -251,6 +253,7 @@ func TestT8n(t *testing.T) {
output: t8nOutput{alloc: true, result: true},
expOut: "exp.json",
},
*/
{ // Test withdrawals transition
base: "./testdata/26",
input: t8nInput{
@ -259,6 +262,8 @@ func TestT8n(t *testing.T) {
output: t8nOutput{alloc: true, result: true},
expOut: "exp.json",
},
// TODO: Cancun not ready
/*
{ // Cancun tests
base: "./testdata/28",
input: t8nInput{
@ -267,6 +272,7 @@ func TestT8n(t *testing.T) {
output: t8nOutput{alloc: true, result: true},
expOut: "exp.json",
},
*/
} {
args := []string{"t8n"}
args = append(args, tc.output.get()...)