Skip to content

Commit

Permalink
Support timeout and size in gazelle_test (#1909)
Browse files Browse the repository at this point in the history
**What type of PR is this?**

Feature

**What package or component does this PR mostly affect?**

bazel's gazelle_test

**What does this PR do? Why is it needed?**

Supports removing noisy warnings like:

```
  WARNING: //:gazelle_test: Test execution time (0.1s excluding execution overhead) outside of range for MODERATE tests. Consider setting timeout="short" or size="small".
```

**Which issues(s) does this PR fix?**

N/A

**Other notes for review**
  • Loading branch information
rockwotj committed Sep 5, 2024
1 parent 533d1ef commit bbcd2f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def gazelle(name, **kwargs):
data = kwargs["data"] if "data" in kwargs else [],
)

def gazelle_test(name, **kwargs):
def gazelle_test(name, size = None, timeout = None, **kwargs):
runner_name, visibility = _gazelle_kwargs_prepare(name, kwargs)

_gazelle_test_runner(
Expand All @@ -247,6 +247,8 @@ def gazelle_test(name, **kwargs):
srcs = [runner_name],
visibility = visibility,
tags = tags,
size = size,
timeout = timeout,
deps = ["@bazel_tools//tools/bash/runfiles"],
data = kwargs["data"] if "data" in kwargs else [],
)

0 comments on commit bbcd2f9

Please sign in to comment.