Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ conventions remain consumer responsibilities.
## Result caching

Tests use normal Bazel caching. Unchanged inputs reuse passing results. Host-browser
tests retain `no-remote`, so their results stay local. Non-hermetic suites must
tests retain `no-remote-exec`, keeping execution local without prohibiting remote
result caching. Non-hermetic suites must
set `tags = ["external", "no-cache"]` at the callsite to force execution and
disable cache storage. `no-cache` alone does not prevent local test-result reuse.

Expand Down Expand Up @@ -187,8 +188,10 @@ hide platform variants. Platform validation uses compatibility constraints;
Linux tools use their architecture transition. Analysis fixtures and host-browser
integration tests that need explicit selection set `manual` at their callsites.

Host-browser tests retain `no-remote` because they rely on a provisioned host
browser. Process-owned tests do not add it: callers must declare their executables
Host-browser tests retain `no-remote-exec` because they run on the configured host.
Cache restrictions are caller-owned: declare browser artifacts and control the
host environment for shared result reuse, or supply cache opt-out tags.
Process-owned tests do not add execution restrictions: callers must declare their executables
or add execution restrictions themselves. Neither mode adds `requires-network`
or `no-sandbox`. The isolated local Linux backend retains its execution constraints
because it provides its own namespace sandbox.
Expand Down
11 changes: 7 additions & 4 deletions docs/host-browsers.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ files must include Chromium/headless shell and any FFmpeg binary required by
suite. Caller-owned Bazel browser repositories supported; these rules do not
introduce another browser downloader or repository format.

Tests stay local and use [normal Bazel result caching](e2e.md#result-caching).
Tests use `no-remote-exec` to stay local while permitting
[normal Bazel result caching](e2e.md#result-caching), including remote cache reuse.
Non-hermetic suites must opt out with caller tags such as `external` plus `no-cache`.
The host browser cache is an environmental input;
Bazel-provisioned browser artifacts additionally make browser files declared
inputs. Neither choice provides VRT's controlled OS/fonts rendering environment.
An externally provisioned host browser cache is an undeclared environmental input;
such suites must opt out unless that environment is tracked in their cache key.
Bazel-provisioned browser artifacts make browser files declared inputs. Reuse
results only across compatible, controlled host environments. Neither choice
provides VRT's controlled OS/fonts rendering environment.

## Consumer migration

Expand Down
2 changes: 1 addition & 1 deletion internal/browser.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def browser_test(
patch_node_fs = False,
args = args,
env_inherit = browser_env_inherit + env_inherit,
tags = ["browser_process_test" if process_owned else "visual_test" if visual else "component_browser_test" if component else "e2e_test"] + ([] if process_owned else ["no-remote"]) + tags,
tags = ["browser_process_test" if process_owned else "visual_test" if visual else "component_browser_test" if component else "e2e_test"] + ([] if process_owned else ["no-remote-exec"]) + tags,
timeout = timeout,
shard_count = shard_count,
**common
Expand Down
8 changes: 4 additions & 4 deletions tests/execution_tags_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("//e2e:defs.bzl", "web_e2e_test")

def _selection_policy_test_impl(ctx):
env = unittest.begin(ctx)
caller_controlled = ["manual", "requires-network", "no-sandbox", "external", "no-cache", "no-remote-cache"] + (["no-remote"] if "browser_process_test" in ctx.attr.observed_tags else [])
caller_controlled = ["manual", "requires-network", "no-sandbox", "external", "no-cache", "no-remote-cache", "no-remote"]
for tag in caller_controlled:
asserts.equals(env, [value for value in ctx.attr.caller_tags if value == tag], [value for value in ctx.attr.observed_tags if value == tag], "Only the caller may add " + tag)
for tag in ctx.attr.caller_tags:
Expand All @@ -27,12 +27,12 @@ def selection_policy_test(name, target, caller_tags = []):

def _cache_policy_test_impl(ctx):
env = unittest.begin(ctx)
for tag in ["no-remote", ctx.attr.mode_tag, "consumer-tag"]:
for tag in ["no-remote-exec", ctx.attr.mode_tag, "consumer-tag"]:
asserts.true(env, tag in ctx.attr.observed_tags, "Missing execution constraint: " + tag)
for tag in ["no-sandbox", "requires-network"]:
asserts.equals(env, ctx.attr.restricted, tag in ctx.attr.observed_tags, "Only the caller may add " + tag)
asserts.equals(env, ["manual"], [tag for tag in ctx.attr.observed_tags if tag == "manual"], "Only the caller may add manual")
for tag in ["external", "no-cache", "no-remote-cache"]:
for tag in ["external", "no-cache", "no-remote-cache", "no-remote"]:
asserts.equals(env, tag in ctx.attr.caller_tags, tag in ctx.attr.observed_tags, "Only the caller may add " + tag)
asserts.equals(env, [], ctx.attr.inherited_env)
return unittest.end(env)
Expand All @@ -56,7 +56,7 @@ def execution_tags_tests():
cmd = "touch $(OUTS)",
)
for mode, macro in [("e2e", web_e2e_test), ("component_browser", component_browser_test)]:
for policy in ["default", "no-cache", "no-remote-cache", "external", "restricted"]:
for policy in ["default", "no-cache", "no-remote-cache", "no-remote", "external", "restricted"]:
name = mode + "_" + policy
tags = ["consumer-tag", "manual"] + (["requires-network", "no-sandbox"] if policy == "restricted" else [] if policy == "default" else [policy])
macro(
Expand Down
Loading