bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.23k stars 4.08k forks source link

[bazel.build] Problem with /reference/test-encyclopedia #17027

Open abentley-ssimwave opened 1 year ago

abentley-ssimwave commented 1 year ago

Searching for "file_test" (without quotes) returns this page, but this page doesn't contain the text "file_test"

abentley-ssimwave commented 1 year ago

It has been several months since I wrote this, but I believe I used your site search at https://docs.bazel.build/ and one of the few results it gave me was the test encyclopedia page. But the page did not contain the text I had searched for. So I used your "Report an issue" link. If that does not provide the context you need, perhaps there is a need to update the "Report an issue" link?

I was concerned because it seemed as if file_test was being treated as two words. I think splitting snake_case words is not precise enough in a programming context. Or maybe file_test was something in the page's HTML/Javascript/CSS code? In any case, an in-page search did not find the term.

I have re-run the search, and a search on file_test gives no results, which is better than giving ones that do not contain the search term. So I guess this bug can be closed.

About file_test, though...

It seems like file_test must have existed at one time, as there are hints about it in various places. I imagine it just compared a generated file against a static file, and failed if they were different. Such a test is still useful, in the spirit of sh_test, and I would use it if it did exist. If it's simply a matter of documenting something that does exist, I'd encourage you to document it.

abentley-ssimwave commented 1 year ago

Here is one of the hints that it exists: https://github.com/bazelbuild/rules_sass/blob/d0cda2205a6e9706ded30f7dd7d30c82b1301fbe/sass/test/npm_sass_library/test_assertions.bzl

In fact, I was able to find many references to what is apparently an undocumented feature here: https://github.com/search?p=2&q=org%3Abazelbuild+file_test&type=Code (there are also some things that reimplement it)

Many of these things are allegedly independent projects like rules_docker, so if file_test is an implementation detail, they should not be using it.

meteorcloudy commented 1 year ago

@comius It looks like https://github.com/bazelbuild/bazel/blob/master/tools/build_rules/test_rules.bzl is currently unmaintained, do you think it should be replaced by rules_testing eventually?