Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 263e3c5

Browse files
authored
Merge pull request #322 from vania-pooh/master
Go 1.19
2 parents e8f8e20 + 294cc7a commit 263e3c5

12 files changed

+38
-39
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup Golang
1515
uses: actions/setup-go@v2
1616
with:
17-
go-version: 1.18.x
17+
go-version: ~1.19.3
1818

1919
- uses: actions/cache@v1
2020
with:

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup Golang
1414
uses: actions/setup-go@v2
1515
with:
16-
go-version: 1.18.x
16+
go-version: ~1.19.3
1717

1818
- uses: actions/cache@v1
1919
with:

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup Golang
1313
uses: actions/setup-go@v2
1414
with:
15-
go-version: 1.18.x
15+
go-version: ~1.19.3
1616

1717
- uses: actions/cache@v1
1818
with:

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.12
1+
FROM alpine:3
22

33
RUN apk add -U ca-certificates tzdata && rm -Rf /var/cache/apk/*
44
COPY cm /

browsers.json

+18-18
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
"files": {
55
"linux": {
66
"amd64": {
7-
"url": "https://chromedriver.storage.googleapis.com/104.0.5112.29/chromedriver_linux64.zip",
7+
"url": "https://chromedriver.storage.googleapis.com/107.0.5304.62/chromedriver_linux64.zip",
88
"filename": "chromedriver"
99
}
1010
},
1111
"darwin": {
1212
"amd64": {
13-
"url": "https://chromedriver.storage.googleapis.com/104.0.5112.29/chromedriver_mac64.zip",
13+
"url": "https://chromedriver.storage.googleapis.com/107.0.5304.62/chromedriver_mac64.zip",
1414
"filename": "chromedriver"
1515
}
1616
},
1717
"windows": {
1818
"386": {
19-
"url": "https://chromedriver.storage.googleapis.com/104.0.5112.29/chromedriver_win32.zip",
19+
"url": "https://chromedriver.storage.googleapis.com/107.0.5304.62/chromedriver_win32.zip",
2020
"filename": "chromedriver.exe"
2121
},
2222
"amd64": {
23-
"url": "https://chromedriver.storage.googleapis.com/104.0.5112.29/chromedriver_win32.zip",
23+
"url": "https://chromedriver.storage.googleapis.com/107.0.5304.62/chromedriver_win32.zip",
2424
"filename": "chromedriver.exe"
2525
}
2626
}
@@ -32,27 +32,27 @@
3232
"files": {
3333
"linux": {
3434
"386": {
35-
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux32.tar.gz",
35+
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux32.tar.gz",
3636
"filename": "geckodriver"
3737
},
3838
"amd64": {
39-
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz",
39+
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz",
4040
"filename": "geckodriver"
4141
}
4242
},
4343
"darwin": {
4444
"amd64": {
45-
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-macos.tar.gz",
45+
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-macos.tar.gz",
4646
"filename": "geckodriver"
4747
}
4848
},
4949
"windows": {
5050
"386": {
51-
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-win32.zip",
51+
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-win32.zip",
5252
"filename": "geckodriver.exe"
5353
},
5454
"amd64": {
55-
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-win64.zip",
55+
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-win64.zip",
5656
"filename": "geckodriver.exe"
5757
}
5858
}
@@ -64,23 +64,23 @@
6464
"files": {
6565
"linux": {
6666
"amd64": {
67-
"url": "https://github.com/operasoftware/operachromiumdriver/releases/download/v.103.0.5060.66/operadriver_linux64.zip",
67+
"url": "https://github.com/operasoftware/operachromiumdriver/releases/download/v.106.0.5249.119 /operadriver_linux64.zip",
6868
"filename": "operadriver_linux64/operadriver"
6969
}
7070
},
7171
"darwin": {
7272
"amd64": {
73-
"url": "https://github.com/operasoftware/operachromiumdriver/releases/download/v.103.0.5060.66/operadriver_mac64.zip",
73+
"url": "https://github.com/operasoftware/operachromiumdriver/releases/download/v.106.0.5249.119 /operadriver_mac64.zip",
7474
"filename": "operadriver_mac64/operadriver"
7575
}
7676
},
7777
"windows": {
7878
"386": {
79-
"url": "https://github.com/operasoftware/operachromiumdriver/releases/download/v.103.0.5060.66/operadriver_win32.zip",
79+
"url": "https://github.com/operasoftware/operachromiumdriver/releases/download/v.106.0.5249.119 /operadriver_win32.zip",
8080
"filename": "operadriver_win32/operadriver.exe"
8181
},
8282
"amd64": {
83-
"url": "https://github.com/operasoftware/operachromiumdriver/releases/download/v.103.0.5060.66/operadriver_win64.zip",
83+
"url": "https://github.com/operasoftware/operachromiumdriver/releases/download/v.106.0.5249.119 /operadriver_win64.zip",
8484
"filename": "operadriver_win64/operadriver.exe"
8585
}
8686
}
@@ -121,27 +121,27 @@
121121
"files": {
122122
"linux": {
123123
"amd64": {
124-
"url": "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/105.0.1321.0/edgedriver_linux64.zip",
124+
"url": "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/107.0.1418.42/edgedriver_linux64.zip",
125125
"filename": "msedgedriver"
126126
}
127127
},
128128
"darwin": {
129129
"amd64": {
130-
"url": "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/105.0.1321.0/edgedriver_mac64.zip",
130+
"url": "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/107.0.1418.42/edgedriver_mac64.zip",
131131
"filename": "msedgedriver"
132132
},
133133
"arm64": {
134-
"url": "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/105.0.1321.0/edgedriver_arm64.zip",
134+
"url": "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/107.0.1418.42/edgedriver_arm64.zip",
135135
"filename": "msedgedriver"
136136
}
137137
},
138138
"windows": {
139139
"386": {
140-
"url": "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/105.0.1321.0/edgedriver_win32.zip",
140+
"url": "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/107.0.1418.42/edgedriver_win32.zip",
141141
"filename": "msedgedriver.exe"
142142
},
143143
"amd64": {
144-
"url": "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/105.0.1321.0/edgedriver_win64.zip",
144+
"url": "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/107.0.1418.42/edgedriver_win64.zip",
145145
"filename": "msedgedriver.exe"
146146
}
147147
}

ci/docker-push.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
docker build -t "$GITHUB_REPOSITORY" -t "$GITHUB_REPOSITORY:$1" .
65
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
6+
docker build --pull -t "$GITHUB_REPOSITORY" -t "$GITHUB_REPOSITORY:$1" .
77
docker push "$GITHUB_REPOSITORY"
88
docker push "$GITHUB_REPOSITORY:$1"

ci/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
export GO111MODULE="on"
44
go test -race -v github.com/aerokube/cm/selenoid -coverprofile=coverage.txt -covermode=atomic -coverpkg github.com/aerokube/cm/selenoid
5+
6+
go install golang.org/x/vuln/cmd/govulncheck@latest
7+
"$(go env GOPATH)"/bin/govulncheck ./...

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/aerokube/cm
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/Masterminds/semver/v3 v3.0.1

selenoid/docker.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88
"github.com/docker/docker/api"
99
"github.com/docker/go-units"
10-
"io/ioutil"
1110
"log"
1211
"sort"
1312

@@ -114,7 +113,7 @@ func NewDockerConfigurator(config *LifecycleConfig) (*DockerConfigurator, error)
114113
}
115114
if c.Quiet {
116115
log.SetFlags(0)
117-
log.SetOutput(ioutil.Discard)
116+
log.SetOutput(io.Discard)
118117
}
119118
err := c.initDockerClient()
120119
if err != nil {
@@ -389,12 +388,12 @@ func (c *DockerConfigurator) Configure() (*SelenoidConfig, error) {
389388
if err != nil {
390389
return nil, fmt.Errorf("failed to marshal json: %v", err)
391390
}
392-
return &cfg, ioutil.WriteFile(getSelenoidConfigPath(c.ConfigDir), data, 0644)
391+
return &cfg, os.WriteFile(getSelenoidConfigPath(c.ConfigDir), data, 0644)
393392
}
394393

395394
func (c *DockerConfigurator) syncWithConfig() (*SelenoidConfig, error) {
396395
c.Titlef(`Requested to sync configuration from "%v"...`, color.GreenString(c.BrowsersJson))
397-
data, err := ioutil.ReadFile(c.BrowsersJson)
396+
data, err := os.ReadFile(c.BrowsersJson)
398397
if err != nil {
399398
return nil, fmt.Errorf("failed to read browsers.json from %s: %v", c.BrowsersJson, err)
400399
}
@@ -418,7 +417,7 @@ func (c *DockerConfigurator) syncWithConfig() (*SelenoidConfig, error) {
418417
}
419418
c.pullVideoRecorderImage()
420419
}
421-
return &cfg, ioutil.WriteFile(getSelenoidConfigPath(c.ConfigDir), data, 0644)
420+
return &cfg, os.WriteFile(getSelenoidConfigPath(c.ConfigDir), data, 0644)
422421
}
423422

424423
func (c *DockerConfigurator) createConfig() SelenoidConfig {

selenoid/docker_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
. "github.com/aandryashin/matchers"
77
"github.com/aerokube/selenoid/config"
88
"github.com/docker/docker/api/types"
9-
"io/ioutil"
109
"net/http"
1110
"net/http/httptest"
1211
"os"
@@ -431,7 +430,7 @@ func TestSyncWithConfig(t *testing.T) {
431430

432431
initialCfgFile := filepath.Join(dir, "initial-browsers.json")
433432
data, _ := json.Marshal(initialCfg)
434-
ioutil.WriteFile(initialCfgFile, data, 0644)
433+
os.WriteFile(initialCfgFile, data, 0644)
435434

436435
lcConfig := LifecycleConfig{
437436
ConfigDir: dir,

selenoid/drivers.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/mitchellh/go-ps"
1717
"gopkg.in/cheggaaa/pb.v1"
1818
"io"
19-
"io/ioutil"
2019
"net/http"
2120
"net/url"
2221
"os"
@@ -285,7 +284,7 @@ func (d *DriversConfigurator) Configure() (*SelenoidConfig, error) {
285284
if err != nil {
286285
return &cfg, fmt.Errorf("failed to marshal json: %v", err)
287286
}
288-
return &cfg, ioutil.WriteFile(getSelenoidConfigPath(d.ConfigDir), data, 0644)
287+
return &cfg, os.WriteFile(getSelenoidConfigPath(d.ConfigDir), data, 0644)
289288
}
290289

291290
func (d *DriversConfigurator) generateConfig(downloadedDrivers []downloadedDriver) SelenoidConfig {
@@ -406,7 +405,7 @@ func extractFile(data []byte, filename string, outputDir string) (string, error)
406405
return untar(data, filename, outputDir)
407406
} else {
408407
outputPath := filepath.Join(outputDir, filename)
409-
err := ioutil.WriteFile(outputPath, data, os.ModePerm)
408+
err := os.WriteFile(outputPath, data, os.ModePerm)
410409
if err != nil {
411410
return "", fmt.Errorf("failed to save file %s: %v", outputPath, err)
412411
}

selenoid/drivers_test.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
. "github.com/aandryashin/matchers"
77
"github.com/aerokube/selenoid/config"
88
"github.com/google/go-github/github"
9-
"io/ioutil"
109
"net/http"
1110
"net/http/httptest"
1211
"net/url"
@@ -276,7 +275,7 @@ func testUnpack(t *testing.T, data []byte, fileName string, fn func([]byte, stri
276275
}
277276

278277
func readFile(t *testing.T, fileName string) []byte {
279-
data, err := ioutil.ReadFile(fileName)
278+
data, err := os.ReadFile(fileName)
280279
if err != nil {
281280
t.Fatal(err)
282281
}
@@ -299,7 +298,7 @@ func mockServerUrl(mockServer *httptest.Server, relativeUrl string) string {
299298
}
300299

301300
func withTmpDir(t *testing.T, prefix string, fn func(*testing.T, string)) {
302-
dir, err := ioutil.TempDir("", prefix)
301+
dir, err := os.MkdirTemp("", prefix)
303302
if err != nil {
304303
t.Fatal(err)
305304
}
@@ -365,7 +364,7 @@ func checkContentsEqual(t *testing.T, outputPath string, expectedFileContents st
365364
if !fileExists(outputPath) {
366365
t.Fatalf("release was not downloaded to %s: file does not exist\n", outputPath)
367366
}
368-
data, err := ioutil.ReadFile(outputPath)
367+
data, err := os.ReadFile(outputPath)
369368
AssertThat(t, err, Is{nil})
370369
AssertThat(t, string(data), EqualTo{expectedFileContents})
371370

@@ -418,7 +417,7 @@ func TestWrongBaseUrl(t *testing.T) {
418417
})
419418
}
420419

421-
//Based on https://npf.io/2015/06/testing-exec-command/
420+
// Based on https://npf.io/2015/06/testing-exec-command/
422421
func TestStartStopProcess(t *testing.T) {
423422
execCommand = fakeExecCommand
424423
defer func() {

0 commit comments

Comments
 (0)