Skip to content

Failing test #1523

@folliehiyuki

Description

@folliehiyuki

The following program sample.go triggers an unexpected result

Just clone the repo and run `go test ./...`.

Expected result

Running `go test ./...` passed.

Got

?   	github.com/traefik/yaegi	[no test files]
ok  	github.com/traefik/yaegi/cmd/yaegi	(cached)
ok  	github.com/traefik/yaegi/example/closure	0.009s
ok  	github.com/traefik/yaegi/example/fs	(cached)
ok  	github.com/traefik/yaegi/example/getfunc	0.010s
?   	github.com/traefik/yaegi/internal/cmd/extract	[no test files]
?   	github.com/traefik/yaegi/internal/cmd/genop	[no test files]
?   	github.com/traefik/yaegi/stdlib	[no test files]
?   	github.com/traefik/yaegi/stdlib/syscall	[no test files]
?   	github.com/traefik/yaegi/stdlib/unrestricted	[no test files]
?   	github.com/traefik/yaegi/stdlib/unsafe	[no test files]
ok  	github.com/traefik/yaegi/example/pkg	0.053s
ok  	github.com/traefik/yaegi/extract	0.031s
ok  	github.com/traefik/yaegi/internal/unsafe2	(cached)
--- FAIL: TestInterpConsistencyBuild (155.45s)
    --- FAIL: TestInterpConsistencyBuild/composite6.go (0.00s)
        interp_consistent_test.go:148: ../_test/composite6.go:6:2: import "github.com/traefik/yaegi/_test/ct1" error: unable to find source related to: "github.com/traefik/yaegi/_test/ct1"
    --- FAIL: TestInterpConsistencyBuild/d3.go (0.00s)
        interp_consistent_test.go:148: ../_test/d3.go:3:8: import "github.com/traefik/yaegi/_test/d2" error: unable to find source related to: "github.com/traefik/yaegi/_test/d2"
    --- FAIL: TestInterpConsistencyBuild/import3.go (0.00s)
        interp_consistent_test.go:148: ../_test/import3.go:3:8: import "github.com/traefik/yaegi/_test/foo" error: unable to find source related to: "github.com/traefik/yaegi/_test/foo"
    --- FAIL: TestInterpConsistencyBuild/import4.go (0.00s)
        interp_consistent_test.go:148: ../_test/import4.go:3:8: import "github.com/traefik/yaegi/_test/p1" error: unable to find source related to: "github.com/traefik/yaegi/_test/p1"
    --- FAIL: TestInterpConsistencyBuild/import5.go (0.00s)
        interp_consistent_test.go:148: ../_test/import5.go:3:8: import "github.com/traefik/yaegi/_test/foo" error: unable to find source related to: "github.com/traefik/yaegi/_test/foo"
    --- FAIL: TestInterpConsistencyBuild/import7.go (0.00s)
        interp_consistent_test.go:148: ../_test/import7.go:3:8: import "github.com/traefik/yaegi/_test/foo-bar" error: unable to find source related to: "github.com/traefik/yaegi/_test/foo-bar"
    --- FAIL: TestInterpConsistencyBuild/import8.go (0.00s)
        interp_consistent_test.go:148: ../_test/import8.go:3:8: import "github.com/traefik/yaegi/_test/b1/foo" error: unable to find source related to: "github.com/traefik/yaegi/_test/b1/foo"
    --- FAIL: TestInterpConsistencyBuild/import9.go (0.00s)
        interp_consistent_test.go:148: ../_test/import9.go:3:8: import "github.com/traefik/yaegi/_test/baz-bat" error: unable to find source related to: "github.com/traefik/yaegi/_test/baz-bat"
    --- FAIL: TestInterpConsistencyBuild/issue-1355.go (0.00s)
        interp_consistent_test.go:148: ../_test/issue-1355.go:3:8: import "github.com/traefik/yaegi/_test/p2" error: unable to find source related to: "github.com/traefik/yaegi/_test/p2"
    --- FAIL: TestInterpConsistencyBuild/method38.go (0.00s)
        interp_consistent_test.go:148: ../_test/method38.go:6:2: import "github.com/traefik/yaegi/_test/method38" error: unable to find source related to: "github.com/traefik/yaegi/_test/method38"
    --- FAIL: TestInterpConsistencyBuild/named3.go (0.00s)
        interp_consistent_test.go:148: ../_test/named3.go:3:8: import "github.com/traefik/yaegi/_test/named3" error: unable to find source related to: "github.com/traefik/yaegi/_test/named3"
    --- FAIL: TestInterpConsistencyBuild/p5.go (0.00s)
        interp_consistent_test.go:148: ../_test/p5.go:3:8: import "github.com/traefik/yaegi/_test/p5" error: unable to find source related to: "github.com/traefik/yaegi/_test/p5"
    --- FAIL: TestInterpConsistencyBuild/p6.go (0.00s)
        interp_consistent_test.go:148: ../_test/p6.go:6:2: import "github.com/traefik/yaegi/_test/p6" error: unable to find source related to: "github.com/traefik/yaegi/_test/p6"
    --- FAIL: TestInterpConsistencyBuild/tag0.go (0.00s)
        interp_consistent_test.go:148: ../_test/tag0.go:6:8: import "github.com/traefik/yaegi/_test/ct" error: unable to find source related to: "github.com/traefik/yaegi/_test/ct"
    --- FAIL: TestInterpConsistencyBuild/var14.go (0.00s)
        interp_consistent_test.go:148: ../_test/var14.go:3:8: import "github.com/traefik/yaegi/_test/vars" error: unable to find source related to: "github.com/traefik/yaegi/_test/vars"
--- FAIL: TestInterpErrorConsistency (0.88s)
    --- FAIL: TestInterpErrorConsistency/import6.go (0.01s)
        interp_consistent_test.go:308: got "../_test/import6.go:3:8: import \"github.com/traefik/yaegi/_test/c1\" error: unable to find source related to: \"github.com/traefik/yaegi/_test/c1\"", want: "import cycle not allowed"
Hello
Hello bar
Hello baz
io: read/write on closed pipe
io: read/write on closed pipe
io: read/write on closed pipe
1:28: undefined: reflect
--- FAIL: TestNoGoFiles (0.00s)
    interp_eval_test.go:1723: failed to detect no Go files: 1:21: import "github.com/traefik/yaegi/_test/p3" error: unable to find source related to: "github.com/traefik/yaegi/_test/p3"
Hello
In Hi:
hello from Myint 4
--- FAIL: TestFile (3.75s)
    --- FAIL: TestFile/composite6.go (0.00s)
        interp_file_test.go:36: ../_test/composite6.go:6:2: import "github.com/traefik/yaegi/_test/ct1" error: unable to find source related to: "github.com/traefik/yaegi/_test/ct1"
    --- FAIL: TestFile/d3.go (0.00s)
        interp_file_test.go:36: ../_test/d3.go:3:8: import "github.com/traefik/yaegi/_test/d2" error: unable to find source related to: "github.com/traefik/yaegi/_test/d2"
    --- FAIL: TestFile/import3.go (0.00s)
        interp_file_test.go:36: ../_test/import3.go:3:8: import "github.com/traefik/yaegi/_test/foo" error: unable to find source related to: "github.com/traefik/yaegi/_test/foo"
    --- FAIL: TestFile/import4.go (0.00s)
        interp_file_test.go:36: ../_test/import4.go:3:8: import "github.com/traefik/yaegi/_test/p1" error: unable to find source related to: "github.com/traefik/yaegi/_test/p1"
    --- FAIL: TestFile/import5.go (0.00s)
        interp_file_test.go:36: ../_test/import5.go:3:8: import "github.com/traefik/yaegi/_test/foo" error: unable to find source related to: "github.com/traefik/yaegi/_test/foo"
    --- FAIL: TestFile/import6.go (0.00s)
        interp_file_test.go:36: got "../_test/import6.go:3:8: import \"github.com/traefik/yaegi/_test/c1\" error: unable to find source related to: \"github.com/traefik/yaegi/_test/c1\"", want: "import cycle not allowed\n\timports github.com/traefik/yaegi/_test/c1"
    --- FAIL: TestFile/import7.go (0.00s)
        interp_file_test.go:36: ../_test/import7.go:3:8: import "github.com/traefik/yaegi/_test/foo-bar" error: unable to find source related to: "github.com/traefik/yaegi/_test/foo-bar"
    --- FAIL: TestFile/import8.go (0.00s)
        interp_file_test.go:36: ../_test/import8.go:3:8: import "github.com/traefik/yaegi/_test/b1/foo" error: unable to find source related to: "github.com/traefik/yaegi/_test/b1/foo"
    --- FAIL: TestFile/import9.go (0.00s)
        interp_file_test.go:36: ../_test/import9.go:3:8: import "github.com/traefik/yaegi/_test/baz-bat" error: unable to find source related to: "github.com/traefik/yaegi/_test/baz-bat"
    --- FAIL: TestFile/issue-1355.go (0.00s)
        interp_file_test.go:36: ../_test/issue-1355.go:3:8: import "github.com/traefik/yaegi/_test/p2" error: unable to find source related to: "github.com/traefik/yaegi/_test/p2"
    --- FAIL: TestFile/method38.go (0.00s)
        interp_file_test.go:36: ../_test/method38.go:6:2: import "github.com/traefik/yaegi/_test/method38" error: unable to find source related to: "github.com/traefik/yaegi/_test/method38"
    --- FAIL: TestFile/method39.go (0.00s)
        interp_file_test.go:36: got "../_test/method39.go:7:2: import \"github.com/traefik/yaegi/_test/method38\" error: unable to find source related to: \"github.com/traefik/yaegi/_test/method38\"", want: "17:11: undefined selector Get"
    --- FAIL: TestFile/named3.go (0.00s)
        interp_file_test.go:36: ../_test/named3.go:3:8: import "github.com/traefik/yaegi/_test/named3" error: unable to find source related to: "github.com/traefik/yaegi/_test/named3"
    --- FAIL: TestFile/p5.go (0.00s)
        interp_file_test.go:36: ../_test/p5.go:3:8: import "github.com/traefik/yaegi/_test/p5" error: unable to find source related to: "github.com/traefik/yaegi/_test/p5"
    --- FAIL: TestFile/tag0.go (0.00s)
        interp_file_test.go:36: ../_test/tag0.go:6:8: import "github.com/traefik/yaegi/_test/ct" error: unable to find source related to: "github.com/traefik/yaegi/_test/ct"
    --- FAIL: TestFile/var14.go (0.00s)
        interp_file_test.go:36: ../_test/var14.go:3:8: import "github.com/traefik/yaegi/_test/vars" error: unable to find source related to: "github.com/traefik/yaegi/_test/vars"
FAIL
FAIL	github.com/traefik/yaegi/interp	176.933s
FAIL

Yaegi Version

0.15.0

Additional Notes

I'm trying to package yaegi for AlpineLinux, but my local build are failing (see the log above).

Also, it would be nice to have race optional when running test. AlpineLinux (and a few other distros) set -buildmode=pie that forbid -race flag.

if raceDetectorSupported(runtime.GOOS, runtime.GOARCH) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions