sourcegraph/client/shared/dev
Noah S-C 75947b347f
bazel: refactor percy mocha tests to js_test instead of js_run_binary + build_test (#60983)
`bazel build` on percy mocha targets (such as //client/web/src/integration:integration-tests) no longer result in actually running the test!

Originally, we used `js_run_binary` with `build_test` as `js_test` doesnt support stamping, and we need to be able to read volatile variables for percy. 
Then, we worked around https://github.com/bazelbuild/bazel/issues/16231 in https://github.com/sourcegraph/sourcegraph/pull/58505 by not explicitly depending on the stamp variables, but exploiting a bit of a hack to read them anyways (will this work with RBE?)
Now, given that we're not explicitly stamping and still using the hack, we can use `js_test` instead, to avoid having the tests run as part of `bazel build`, instead only when we run `bazel test` (as is good 😌)

It is apparently possible to work around https://github.com/bazelbuild/bazel/issues/16231 when using disk/remote caches, but only for local builds (so no remote builds) according to [the following comment](https://github.com/bazelbuild/bazel/issues/16231#issuecomment-1772835555), but we would still need: 
1. `js_test` to support stamping and
2. this workaround to also apply to remote execution (as we're considering that once its supported in Aspect Workflows)

todo: update doc/dev/background-information/bazel/web_overview.md in new docs repo

## Test plan

CI 🎉
2024-03-26 10:58:20 +00:00
..
build_code_intel_extensions.bzl bazel: fetch code-intel-extensions bundle as bazel repository (#59708) 2024-01-25 04:50:54 -08:00
BUILD.bazel bazel: refactor percy mocha tests to js_test instead of js_run_binary + build_test (#60983) 2024-03-26 10:58:20 +00:00
buildCodeIntelExtensions.js bazel: fetch code-intel-extensions bundle as bazel repository (#59708) 2024-01-25 04:50:54 -08:00
customMochaSpecReporter.js disable slow eslint rules, remove unused disable directives (#57788) 2023-10-23 13:23:44 -07:00
extractGraphQlOperationCodegenPlugin.js bazel: generate graphql operation interfaces, css module typings (#45756) 2022-12-20 19:11:09 -08:00
generate_graphql_operations.bzl Buildifier fixes (#48691) 2023-03-07 10:15:26 +01:00
generate_schema.bzl Buildifier fixes (#48691) 2023-03-07 10:15:26 +01:00
generateCssModulesTypes.ts generate .css.d.ts for non-SCSS (plain .css) files as well (#58546) 2023-11-26 15:11:34 -08:00
generateGraphQlOperations.ts Revert vs-code extension deleting (#61258) 2024-03-20 13:53:27 +01:00
generateSchema.ts remove gulp (task runner) (#57963) 2023-10-29 12:09:50 -07:00
runMochaTestsWithPercy.js bazel: refactor percy mocha tests to js_test instead of js_run_binary + build_test (#60983) 2024-03-26 10:58:20 +00:00
suppressPollyErrors.js bazel: add integration test target (#49279) 2023-03-30 06:01:09 -07:00
tools.bzl bazel: wrap module style typings in js_library() rule (#46189) 2023-01-08 22:30:20 -08:00