Skip to content

Commit

Permalink
Prepare for 0.3.2 release. (#376)
Browse files Browse the repository at this point in the history
- Get 0.3.2 browsers working on Linux.
- Fix quit handler test when using Sauce.
- Update Sauce browser versions.
  • Loading branch information
DrMarcII authored Aug 23, 2019
1 parent 49c8a22 commit 62062b4
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion browsers/chromium-local.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"environment" : "local",
"capabilities" : {
"browserName" : "chromium",
"browserName" : "chrome",
"goog:chromeOptions" : {
"binary" : "%FILE:CHROMIUM%",
"args" : [
Expand Down
2 changes: 1 addition & 1 deletion browsers/sauce/chrome-win10-connect.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"capabilities": {
"browserName": "chrome",
"platform": "Windows 10",
"version": "64.0",
"version": "76.0",
"name": "%METADATA:LABEL%",
"tags": ["%METADATA:ENVIRONMENT%", "%METADATA:TEST_LABEL%", "%METADATA:BROWSER_LABEL%", "%METADATA:CONFIG_LABEL%"],
"tunnel-identifier": "%SAUCE:TUNNEL_ID%"
Expand Down
2 changes: 1 addition & 1 deletion browsers/sauce/chrome-win10.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"capabilities": {
"browserName": "chrome",
"platform": "Windows 10",
"version": "64.0",
"version": "76.0",
"name": "%METADATA:LABEL%",
"build": "%ENV:BUILD_TAG%",
"tags": ["%METADATA:ENVIRONMENT%", "%METADATA:TEST_LABEL%", "%METADATA:BROWSER_LABEL%", "%METADATA:CONFIG_LABEL%"],
Expand Down
14 changes: 11 additions & 3 deletions go/bazel/bazel.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ func Runfile(path string) (string, error) {
}

if cmdhelper.IsTruthyEnv("RUNFILES_MANIFEST_ONLY") {
return runfileInManifest(path)
filename, err := runfileInManifest(path)
if err != nil {
return "", fmt.Errorf("RUNFILES_MANIFEST_ONLY is set but unable to locate %q in RUNFILES_MANIFEST_FILE: %v", path, err)
}
return filename, nil
}

runfiles, err := RunfilesPath()
if err != nil {
return "", err
return "", fmt.Errorf("Unable to locate TEST_SRCDIR while looking for %q: %v", path, err)
}

filename := filepath.Join(runfiles, path)
Expand All @@ -60,7 +64,11 @@ func Runfile(path string) (string, error) {
return filename, nil
}

return runfileInManifest(path)
filename, err = runfileInManifest(path)
if err != nil {
return "", fmt.Errorf("Unable to locate %q in TEST_SRCDIR or RUNFILES_MANIFEST_FILE", path)
}
return filename, nil
}

// RunfilesPath return the path to the run files tree for this test.
Expand Down
4 changes: 0 additions & 4 deletions go/wsl/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func New(ctx context.Context, localHost, sessionID string, caps map[string]inter
if response.StatusCode == http.StatusOK {
respJSON := map[string]interface{}{}
if err := json.NewDecoder(response.Body).Decode(&respJSON); err == nil {
log.Printf("Response: %+v", respJSON)
if status, ok := respJSON["status"].(float64); ok {
if int(status) == 0 {
break
Expand Down Expand Up @@ -345,7 +344,6 @@ func (d *Driver) startDriver() (chan error, error) {

go func() {
err := cmd.Wait()
log.Printf("%s has exited: %v", d.caps.binary, err)

if err := d.portRecycler.RecyclePorts(); err != nil {
log.Printf("Error cleaning up used ports: %v", err)
Expand Down Expand Up @@ -522,10 +520,8 @@ func (f *fakeResponseWriter) Header() http.Header {
}

func (f *fakeResponseWriter) Write(b []byte) (int, error) {
log.Printf("%s body: %s", f.prefix, string(b))
return len(b), nil
}

func (f *fakeResponseWriter) WriteHeader(statusCode int) {
log.Printf("%s status code: %d", f.prefix, statusCode)
}
2 changes: 1 addition & 1 deletion go/wtl/proxy/driverhub/quithandler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ go_web_test_suite(
srcs = ["quit_handler_test.go"],
browsers = [
"//browsers:chromium-local",
"//browsers:firefox-local",
"//browsers/sauce:chrome-win10",
],
data = ["//testdata"],
Expand All @@ -45,6 +44,7 @@ go_web_test_suite(
},
deps = [
"//go/bazel:go_default_library",
"//go/httphelper:go_default_library",
"//go/portpicker:go_default_library",
"//go/webtest:go_default_library",
"@com_github_tebeka_selenium//:go_default_library",
Expand Down
8 changes: 7 additions & 1 deletion go/wtl/proxy/driverhub/quithandler/quit_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"time"

"github.com/bazelbuild/rules_webtesting/go/bazel"
"github.com/bazelbuild/rules_webtesting/go/httphelper"
"github.com/bazelbuild/rules_webtesting/go/portpicker"
"github.com/bazelbuild/rules_webtesting/go/webtest"
"github.com/tebeka/selenium"
Expand All @@ -45,7 +46,12 @@ func TestMain(m *testing.M) {
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), http.FileServer(http.Dir(dir))))
}()

testpage = fmt.Sprintf("http://localhost:%d/testpage.html", port)
host, err := httphelper.FQDN()
if err != nil {
log.Fatal(err)
}

testpage = fmt.Sprintf("http://%s:%d/testpage.html", host, port)

os.Exit(m.Run())
}
Expand Down
11 changes: 7 additions & 4 deletions third_party/chromedriver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ web_test_archive(
archive = "@org_chromium_chromedriver//file",
extract = "build",
named_files = select({
"//common/conditions:windows": {
"CHROMEDRIVER": "chromedriver.exe",
"//common/conditions:linux": {
"CHROMEDRIVER": "chromedriver_linux64/chromedriver",
},
"//common/conditions:mac": {
"CHROMEDRIVER": "chromedriver_mac64/chromedriver",
},
"//conditions:default": {
"CHROMEDRIVER": "chromedriver",
"//common/conditions:windows": {
"CHROMEDRIVER": "chromedriver_win32/chromedriver.exe",
},
}),
visibility = ["//browsers:__subpackages__"],
Expand Down

0 comments on commit 62062b4

Please sign in to comment.