From cf79a103222d9d301c572cb621f0e717c3afaf03 Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Mon, 22 Mar 2021 11:35:05 +0300 Subject: [PATCH 1/3] Bump Golang to 1.16 --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- go.mod | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7b12d4..2e48fdd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.16.x - uses: actions/cache@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3d3f43..218974d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.16.x - uses: actions/cache@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d45484..f545512 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.16.x - uses: actions/cache@v1 with: diff --git a/go.mod b/go.mod index ce6d418..8a6c4be 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/aerokube/ggr - go 1.15 +go 1.16 require ( github.com/aandryashin/matchers v0.0.0-20160729131923-5eb67beb188b From e1e1e570a7bb505386e2b8ef42103f9bbf6f62c1 Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Mon, 22 Mar 2021 12:33:48 +0300 Subject: [PATCH 2/3] Ability to print labels from extension capabilities (fixes #339) --- proxy.go | 5 +++++ proxy_test.go | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/proxy.go b/proxy.go index d91c101..ef33155 100644 --- a/proxy.go +++ b/proxy.go @@ -98,6 +98,11 @@ func (c caps) capabilities(fn func(m map[string]interface{}, w3c bool)) { if alwaysMatch, ok := m[keys.alwaysMatch]; ok { if m, ok := alwaysMatch.(map[string]interface{}); ok { fn(m, true) + for k, v := range m { // Extension capabilities have ":" in key + if ec, ok := v.(map[string]interface{}); ok && strings.Contains(k, ":") { + fn(ec, true) + } + } } } } diff --git a/proxy_test.go b/proxy_test.go index 5d46e81..53c8e0a 100644 --- a/proxy_test.go +++ b/proxy_test.go @@ -880,7 +880,7 @@ func TestStartSessionWithDefaultVersionW3C(t *testing.T) { mux.HandleFunc("/wd/hub/session", postOnly(func(w http.ResponseWriter, r *http.Request) { body, _ := ioutil.ReadAll(r.Body) r.Body.Close() - var sess map[string]map[string]map[string]string + var sess map[string]map[string]map[string]interface{} err := json.Unmarshal(body, &sess) w.Write([]byte(`{"sessionId":"123"}`)) AssertThat(t, err, Is{nil}) @@ -911,7 +911,7 @@ func TestStartSessionWithDefaultVersionW3C(t *testing.T) { }}}} updateQuota(user, browsers) - createSession(`{"capabilities":{"alwaysMatch":{"browserName":"browser"}}}`) + createSession(`{"capabilities":{"alwaysMatch":{"browserName":"browser", "selenoid:options": {"labels": {"some-key": "some-value"}}}}}`) } func TestClientClosedConnection(t *testing.T) { From 45c02dfbe5286f5fe1a12a00804d90204c9f7bec Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Mon, 22 Mar 2021 12:34:51 +0300 Subject: [PATCH 3/3] Bump Alpine image version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3d68570..70ce04f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.12 +FROM alpine:3 RUN apk add -U tzdata ca-certificates && rm -Rf /var/cache/apk/* COPY ggr /usr/bin