diff options
author | earl-warren <earl-warren@noreply.code.forgejo.org> | 2024-12-27 12:45:42 +0100 |
---|---|---|
committer | earl-warren <earl-warren@noreply.code.forgejo.org> | 2024-12-27 12:45:42 +0100 |
commit | 66ad8581f10f3b6b11bc28e72c7fef4d4b40c38a (patch) | |
tree | 4ac6f55f049f481a672808f9a9f60f0477ee5cfc | |
parent | Merge pull request 'Update module github.com/docker/cli to v25.0.7+incompatib... (diff) | |
parent | chore(tests): add ./pkg/container tests (diff) | |
download | forgejo-act-66ad8581f10f3b6b11bc28e72c7fef4d4b40c38a.tar.xz forgejo-act-66ad8581f10f3b6b11bc28e72c7fef4d4b40c38a.zip |
Merge pull request 'chore(tests): add ./pkg/container tests' (#86) from earl-warren/act:wip-container-tests into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/86
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
-rw-r--r-- | .forgejo/workflows/test.yml | 2 | ||||
-rw-r--r-- | pkg/container/docker_cli_test.go | 4 | ||||
-rw-r--r-- | pkg/container/docker_run_test.go | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index 2fb8e9c..b329fad 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -58,7 +58,7 @@ jobs: - name: build without docker run: go build -tags WITHOUT_DOCKER -v ./... - name: unit test - run: go test -v ./pkg/jobparser ./pkg/model ./pkg/exprparser + run: go test -short -v ./pkg/container ./pkg/jobparser ./pkg/model ./pkg/exprparser integration: runs-on: lxc-bookworm diff --git a/pkg/container/docker_cli_test.go b/pkg/container/docker_cli_test.go index a6445be..d871a89 100644 --- a/pkg/container/docker_cli_test.go +++ b/pkg/container/docker_cli_test.go @@ -377,16 +377,12 @@ func TestParseWithExpose(t *testing.T) { invalids := map[string]string{ ":": "invalid port format for --expose: :", "8080:9090": "invalid port format for --expose: 8080:9090", - "/tcp": "invalid range format for --expose: /tcp, error: Empty string specified for ports.", - "/udp": "invalid range format for --expose: /udp, error: Empty string specified for ports.", "NaN/tcp": `invalid range format for --expose: NaN/tcp, error: strconv.ParseUint: parsing "NaN": invalid syntax`, "NaN-NaN/tcp": `invalid range format for --expose: NaN-NaN/tcp, error: strconv.ParseUint: parsing "NaN": invalid syntax`, "8080-NaN/tcp": `invalid range format for --expose: 8080-NaN/tcp, error: strconv.ParseUint: parsing "NaN": invalid syntax`, "1234567890-8080/tcp": `invalid range format for --expose: 1234567890-8080/tcp, error: strconv.ParseUint: parsing "1234567890": value out of range`, } valids := map[string][]nat.Port{ - "8080/tcp": {"8080/tcp"}, - "8080/udp": {"8080/udp"}, "8080/ncp": {"8080/ncp"}, "8080-8080/udp": {"8080/udp"}, "8080-8082/tcp": {"8080/tcp", "8081/tcp", "8082/tcp"}, diff --git a/pkg/container/docker_run_test.go b/pkg/container/docker_run_test.go index 9e85fb7..6a2c05b 100644 --- a/pkg/container/docker_run_test.go +++ b/pkg/container/docker_run_test.go @@ -20,6 +20,9 @@ import ( ) func TestDocker(t *testing.T) { + if testing.Short() { + t.Skip("skipping integration test") + } ctx := context.Background() client, err := GetDockerClient(ctx) assert.NoError(t, err) |