Commit Graph

5 Commits

Author SHA1 Message Date
Greg Magolan
afc8577b6f
build: add buildifier check to Aspect Workflows (#58566)
* build: add buildifier check to Aspect Workflows

* exclude squirrel/test_repos/starlark

* buildifier

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2023-11-27 14:58:01 +02:00
Jean-Hadrien Chabran
c9ab4562c9
bzl: enable go_test to turn off race detector (#54747)
We might need to turn off the race detector for a target, see
https://sourcegraph.slack.com/archives/C04MYFW01NV/p1688741821325559

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

CI
2023-07-10 15:16:43 +00:00
Jean-Hadrien Chabran
cdf08af780
bzl+doc: add convenient way of running all short go tests locally w/ Bazel (#53330)
Adds a `--config go-short` flag to be used in conjunction to `bazel test
//...` to provide a convenient way of running all short go tests
locally.

TODO JH: 

- [ ] update the `go/bazel` link when merging this. 

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

CI + local preview for the docs.
2023-06-14 21:00:13 +02:00
Jean-Hadrien Chabran
47e7e52a90
bzl: fix timeout warnings + add short as default for Go tests (#53306)
Rather than tagging all `go_test` rules with `timeout = "short"`, we
leverage the wrapped `go_test` macro we already have to set the timeout
to `"short"` unless specified otherwise.

And I've added explicitly the `timeout = "moderate"` on the slower
tests. Only a few warnings remains, but they're unrelated to Go and will
be taken on in another PR.

@keegancsmith before you ask, yes, that's where I'll put an additional
tag for the go unit test as we discussed earlier :) I'll cover the doc
part of this PR then, as I'll extract some Go stuff into its own page.

This PR fixes about 30 warnings.

 

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

CI, observing that we don't see the warnings anymore.
2023-06-12 17:06:27 +01:00
Jean-Hadrien Chabran
3d36d34b3d
ci: re-enable race detection (#52776)
The previous approach to enable race detection was too radical and
accidently led to build our binaries with the race flage enabled, which
caused issues when building images down the line.

This happened because putting a `test --something` in bazelrc also sets
it on `build` which is absolutely not what we wanted. Usually folks get
this one working by having a `--stamp` config setting that fixes this
when releasing binaries, which we don't at this stage, as we're still
learning Bazel.

Luckily, this was caught swiftly. The current approach insteads takes a
more granular approach, which makes the `go_test` rule uses our own
variant, which injects the `race = "on"` attribute, but only on
`go_test`.


## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

CI, being a main-dry-run, this will cover the container building jobs,
which were the ones failing.

---------

Co-authored-by: Alex Ostrikov <alex.ostrikov@sourcegraph.com>
2023-06-05 20:41:47 +02:00