Comments (6)
@fmeum @linzhp This is pretty much an RFC. I discovered this recently when digging through why go_test
is rendered on BuildBuddy UI differently from other rules.
Here is the before verbose enabled
and here is the after test verbose enabled
I think for many of our customers who are using rules_go, this small improvement could be a BIG deal.
I could send a simple PR if I could get the current maintainers to agree on this issue.
from rules_go.
--test_output=errors
and GO_TEST_WRAP_TESTV=1
are independent. Even without --test_output=errors
, when a test fail, people will have to open the test.log to see what's going on. GO_TEST_WRAP_TESTV=1
is too verbose for most cases, local dev or CI, terminal output or test.log. This makes it even worse on CI jobs that runs thousands of tests from one shard, especially with RBE. In fact, we only set GO_TEST_WRAP_TESTV
in a job that is detecting flaky tests, which needs to analyze test.xml. As test.xml is meant to be read by a program, it's easy for that program to set GO_TEST_WRAP_TESTV
too.
So I agree with @robbertvanginkel that GO_TEST_WRAP_TESTV=0
is a better default. BuildBuddy UI does make the test result look nicer with GO_TEST_WRAP_TESTV=1
, but you can set it by default from BuildBuddy UI, right?
from rules_go.
I think there is a discoverability problem with GO_TEST_WRAP_TESTV
though. It took me quite some digging to find this config knob and I think we have plenty of customers who would want it enabled.
CI jobs that runs thousands of tests from one shard
😱. I guess it's fine if the tests are relatively fast themselves.
but you can set it by default from BuildBuddy UI, right?
The default still needs to be set either on the test rule or on the .bazelrc
config.
I strongly believe that this could be quite beneficial for use cases outside of BuildBuddy as well. Knowing how much time is spent on each test func in a target is valuable for development purposes.
from rules_go.
Could we have both? Always specify test.v
in the wrapper and use the output to populate the XML file, but by default filter out most lines.
I could see this becoming a problem with test cases that execute in parallel though as their outputs may mix.
from rules_go.
I like your idea @fmeum
We could potentially filter these out ourselves from the test log? 🤔
=== RUN TestHelloWorld
--- PASS: TestHelloWorld (0.00s)
=== RUN TestHelloWorld2
--- PASS: TestHelloWorld2 (0.00s)
=== RUN TestHelloWorld3
--- PASS: TestHelloWorld3 (0.00s)
=== RUN TestHelloWorld4
--- PASS: TestHelloWorld4 (0.00s)
=== RUN TestHelloWorld5
The ordering here
main_test.go:18: blah
--- FAIL: TestHelloWorld5 (0.00s)
FAIL
is slightly different from
--- FAIL: TestHelloWorld5 (0.00s)
main_test.go:18: blah
FAIL
though.
I could see this becoming a problem with test cases that execute in parallel though as their outputs may mix.
I think these should be funneled through Go's testing
package already, and if it's not, then it would make not much of a difference here?
from rules_go.
The default still needs to be set either on the test rule or on the .bazelrc config.
The way we do it is to have this in the default .bazelrc:
test --test_output=errors
try-import %workspace%/.ci.bazelrc
So people will see the test errors on local machines and most CI jobs. Different CI jobs populate different .ci.bazelrc
. For the jobs that need test.xml, they can either run with --test_env=GO_TEST_WRAP_TESTV=1
or put that in .ci.bazelrc
.
from rules_go.
Related Issues (20)
- Rules_go 0.47.0 downgraded the gomock dependency from 1.7.0-rc1 to 1.6.0, which broke support for generics in mocks HOT 1
- How to test an analysis.Analyzer?
- Differentiate compile actions under go_test
- `GoLink` for Gazelle fails on Go 1.20 or greater HOT 2
- goleak broken by recent timeout changes
- How do I depend on the "bazel" package of rules_go when using MODULE.bazel HOT 3
- [BAZEL CI] rules_go cgo:opts_test is failing with Bazel@HEAD HOT 1
- go_tool_binary / GoToolchainBinaryBuild actions don't always run on the correct platform
- GoStdlib, GoCompilePkg, etc. don't respect exec_compatible_with of the underlying C/C++ toolchain HOT 1
- Calls to https://go.dev/dl/?mode=json are breaking airgapped builds - provide way to avoid these HOT 6
- rules_go + protobufs + experimental_sibling_repository_layout fails to build HOT 2
- How do you use protoc with 0.48.0? HOT 4
- Proposal: Fail protoc code gen on missing expected output files
- Embedding native buildinfo in Bazel binaries
- go_proto_library: Issue/New Feature for output path generation.
- How to create go_proto_library automatically HOT 1
- rules_go 0.48.0 inconsistent strict deps behavior between bzlmod enabled and disabled HOT 2
- Cross-compilation to Linux on MacOS sets CGO_ENABLED=0 even though cgo=True in go_library and platform set to linux_amd64_cgo HOT 7
- link: package conflict error
- Allow pure without purego HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_go.