Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to finx bindtest #7167

Merged
merged 7 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v4
with:
go-version: '1.19'
Expand Down Expand Up @@ -60,9 +59,6 @@ jobs:
- name: Test
run: make test

# - name: Test HistoryV3
# run: make test3

tests-windows:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
strategy:
Expand All @@ -72,7 +68,6 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v4
with:
go-version: '1.19'
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: git submodule update --init --recursive --force

- uses: actions/setup-go@v4
with:
go-version: '1.19'
Expand Down
18 changes: 13 additions & 5 deletions accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"testing"

"github.com/ledgerwatch/erigon-lib/common/dir"
"github.com/ledgerwatch/log/v3"
)

var bindTests = []struct {
Expand Down Expand Up @@ -1792,12 +1792,12 @@ var bindTests = []struct {
// the requested tester run against it.
func TestGolangBindings(t *testing.T) {
// Skip the test if no Go command can be found
gocmd := runtime.GOROOT() + "/bin/go"
gocmd := "go"
if !dir.FileExist(gocmd) {
t.Skip("go sdk not found for testing")
}
// Create a temporary workspace for the test suite
ws := t.TempDir()
ws := "" //t.TempDir()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally left in?


pkg := filepath.Join(ws, "bindtest")
if err := os.MkdirAll(pkg, 0700); err != nil {
Expand Down Expand Up @@ -1843,6 +1843,14 @@ func TestGolangBindings(t *testing.T) {
t.Fatalf("failed to convert binding test to modules: %v\n%s", err, out)
}
pwd, _ := os.Getwd()
replacer2 := exec.Command(gocmd, "version")
replacer2.Dir = pkg
if out, err := replacer2.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
} else {
log.Warn("go version", "v", string(out), "gocmd", gocmd)
}

replacer := exec.Command(gocmd, "mod", "edit", "-replace", "github.com/ledgerwatch/erigon="+filepath.Join(pwd, "..", "..", "..")) // Repo root
replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
Expand All @@ -1859,8 +1867,8 @@ func TestGolangBindings(t *testing.T) {
if out, err := tidier.CombinedOutput(); err != nil {
t.Fatalf("failed to tidy Go module file: %v\n%s", err, out)
}
// Test the entire package and report any failures
cmd := exec.Command(gocmd, "test", "-v", "-count", "1", "-tags", "mdbx")
//Test the entire package and report any failures
cmd := exec.Command(gocmd, "test", "-v", "-count", "1")
cmd.Dir = pkg
if out, err := cmd.CombinedOutput(); err != nil {
t.Fatalf("failed to run binding test: %v\n%s", err, out)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/ledgerwatch/erigon
go 1.19

require (
github.com/ledgerwatch/erigon-lib v0.0.0-20230323051917-d7b01ea68f75
github.com/ledgerwatch/erigon-lib v0.0.0-20230323062604-e15093d30e18
github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20230306083105-1391330d62a3
github.com/ledgerwatch/log/v3 v3.7.0
github.com/ledgerwatch/secp256k1 v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3PYPwICLl+/9oulQauOuETfgFvhBDffs0=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
github.com/ledgerwatch/erigon-lib v0.0.0-20230323051917-d7b01ea68f75 h1:RO73OYf0mwvbrRx9N4rjtQ/2rsYfa9n6/5FRO0VBhm4=
github.com/ledgerwatch/erigon-lib v0.0.0-20230323051917-d7b01ea68f75/go.mod h1:dagOLJlpxlMcQX4a2KIdzyCBIMtk6+ccqikNQf2uDwA=
github.com/ledgerwatch/erigon-lib v0.0.0-20230323062604-e15093d30e18 h1:deIunwmAyt1KbzcFEOD5MwzThJFPO2E+2kDpaSAJDFI=
github.com/ledgerwatch/erigon-lib v0.0.0-20230323062604-e15093d30e18/go.mod h1:dagOLJlpxlMcQX4a2KIdzyCBIMtk6+ccqikNQf2uDwA=
github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20230306083105-1391330d62a3 h1:tfzawK1gIIgRjVZeANXOr0Ziu+kqCIBuKMe0TXfl5Aw=
github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20230306083105-1391330d62a3/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo=
github.com/ledgerwatch/log/v3 v3.7.0 h1:aFPEZdwZx4jzA3+/Pf8wNDN5tCI0cIolq/kfvgcM+og=
Expand Down