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
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"chrome": {
"defaultRegistryUrlTemplate": "https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json",
"transformTemplates": [
"{ \"releases\": versions.{ \"version\": version, \"sourceUrl\": downloads.chrome[platform=\"{{depName}}\"].url } }"
"{ 'releases': versions[$count(downloads.'{{depName}}') > 0].{ 'version': version } }"
]
}
},
Expand Down
10 changes: 4 additions & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ rules_ts_ext.deps(
use_repo(rules_ts_ext, "npm_typescript")

# Pull in Chrome for use in tests
chrome_linux64 = use_extension("//build_defs:chrome.bzl", "chrome")
chrome_linux64.download(
package = "chrome",
platform = "linux64",
version = "122.0.6217.0", # renovate: datasource=custom.chrome depName=linux64 versioning=loose
chrome = use_extension("//build_defs/chrome:extension.bzl", "chrome")
chrome.download(
version = "122.0.6217.0", # renovate: datasource=custom.chrome depName=chrome versioning=loose
)
use_repo(chrome_linux64, "chrome_linux64")
use_repo(chrome, "chrome_chrome_linux64")
40 changes: 0 additions & 40 deletions build_defs/chrome.bzl

This file was deleted.

Empty file added build_defs/chrome/BUILD.bazel
Empty file.
49 changes: 49 additions & 0 deletions build_defs/chrome/extension.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

PACKAGES = ("chrome",)
PLATFORMS = ("linux64", "win64", "mac-x64")

def _chrome_download(package, platform, version):
http_archive(
name = "chrome_{package}_{platform}".format(
package = package,
platform = platform,
),
build_file_content = """
filegroup(
name = "pkg",
data = glob(["{package}-{platform}/**"]),
visibility = ["//visibility:public"],
)
""".format(
package = package,
platform = platform,
),
urls = [
"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/{version}/{platform}/{package}-{platform}.zip".format(
package = package,
platform = platform,
version = version,
)],
)


def _chrome_dependencies_impl(_ctx):
for mod in _ctx.modules:
for download in mod.tags.download:
for package in PACKAGES:
for platform in PLATFORMS:
_chrome_download(package, platform, download.version)

_download = tag_class(
attrs = {
"version": attr.string(),
}
)

chrome = module_extension(
implementation = _chrome_dependencies_impl,
tag_classes = {
"download": _download,
}
)
2 changes: 1 addition & 1 deletion test/e2e/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ go_test(
data = [
"//:chrome-ssh-agent.zip",
"//:chrome-ssh-agent-beta.zip",
"@chrome_linux64//:chrome-linux64/chrome",
"@chrome_chrome_linux64//:pkg",
],
importpath = "github.com/google/chrome-ssh-agent/test",
deps = [
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

var (
chromePath = testutil.MustRunfile("_main~chrome~chrome_linux64/chrome-linux64/chrome")
chromePath = testutil.MustRunfile("_main~chrome~chrome_chrome_linux64/chrome-linux64/chrome")
)

type LogLevel int
Expand Down