Unit test inconsistencies #330

Merged
ABastionOfSanity merged 6 commits from unit_test_inconsistencies into v1.11.2-statediff-v4 2023-03-07 21:04:11 +00:00
3 changed files with 17 additions and 6 deletions

View File

@ -37,6 +37,7 @@ jobs:
- name: Run unit tests
run: |
make test
statediff-unit-test:
name: Run state diff unit test
@ -121,7 +122,6 @@ jobs:
run: |
COUNT=0
ATTEMPTS=15
sleep 30;
docker logs local_go-ethereum_1
docker compose -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-sharding.yml" -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" exec go-ethereum ps aux
until $(docker compose -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-sharding.yml" -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" cp go-ethereum:/root/transaction_info/STATEFUL_TEST_DEPLOYED_ADDRESS ./STATEFUL_TEST_DEPLOYED_ADDRESS) || [[ $COUNT -eq $ATTEMPTS ]]; do echo -e "$(( COUNT++ ))... \c"; sleep 10; done

6
Jenkinsfile vendored
View File

@ -33,12 +33,14 @@ pipeline {
GOMODCACHE = "/tmp/go/pkg/mod"
GOWORK=""
//GOFLAGS=""
HOME="${WORKSPACE}"
}
steps {
echo 'Testing ...'
//sh '/usr/local/go/bin/go test -p 1 -v ./...'
echo 'Testing geth units...'
sh 'make test'
echo 'Testing statediffing geth...'
sh 'make statedifftest'
}
}
stage('Packaging') {

View File

@ -23,14 +23,23 @@ import (
"testing"
)
func homeDir() string {
if home := os.Getenv("HOME"); home != "" {
return home
}
if usr, err := user.Current(); err == nil {
return usr.HomeDir
}
return ""
}
func TestPathExpansion(t *testing.T) {
user, _ := user.Current()
var tests map[string]string
if runtime.GOOS == "windows" {
tests = map[string]string{
`/home/someuser/tmp`: `\home\someuser\tmp`,
`~/tmp`: user.HomeDir + `\tmp`,
`~/tmp`: homeDir() + `\tmp`,
`~thisOtherUser/b/`: `~thisOtherUser\b`,
`$DDDXXX/a/b`: `\tmp\a\b`,
`/a/b/`: `\a\b`,
@ -41,7 +50,7 @@ func TestPathExpansion(t *testing.T) {
} else {
tests = map[string]string{
`/home/someuser/tmp`: `/home/someuser/tmp`,
`~/tmp`: user.HomeDir + `/tmp`,
`~/tmp`: homeDir() + `/tmp`,
`~thisOtherUser/b/`: `~thisOtherUser/b`,
`$DDDXXX/a/b`: `/tmp/a/b`,
`/a/b/`: `/a/b`,