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

Lost x_defs attribute on test execution #3134

Closed
bozaro opened this issue Apr 29, 2022 · 0 comments · Fixed by #3135
Closed

Lost x_defs attribute on test execution #3134

bozaro opened this issue Apr 29, 2022 · 0 comments · Fixed by #3135

Comments

@bozaro
Copy link
Contributor

bozaro commented Apr 29, 2022

What version of rules_go are you using?

v0.31.0

What version of gazelle are you using?

None

What version of Bazel are you using?

5.1.1

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

Ubuntu 21.10

Any other potentially useful information about your toolchain?

None

What did you do?

I lost all x_defs declaration on some packages (qux) with dependency graph like:

graph TD
    foo
    foo_test
    bar
    baz
    qux

    foo_test --> bar
    foo_test -.-> foo
    bar --> baz
    bar --> foo
    baz --> qux

Minimal workspace for reproducing the error: https://github.com/bozaro/rules_go_xdefs

Reproducing steps:

What did you expect to see?

All tests passed.

What did you see instead?

I have lost x_defs attribute only in qux package and see test error:

INFO: From Testing //foo:foo_test:
==================== Test output for //foo:foo_test:
--- FAIL: TestQux (0.00s)
    foo_test.go:23: Not equal: 
        expected: Qux
        actual  : 
FAIL
================================================================================

Variable Qux set by:

go_library(
    name = "qux",
    srcs = ["qux.go"],
    importpath = "github.com/bozaro/rules_go_xdefs/qux",
    visibility = ["//visibility:public"],
    x_defs = {"Qux": "Qux"},
)
bozaro added a commit to bozaro/rules_go that referenced this issue Apr 29, 2022
achew22 pushed a commit that referenced this issue May 4, 2022
* Fix lost `x_defs` on test execution

Fixed: #3134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant