Skip to content

Commit f976625

Browse files
committed
remove docker
1 parent 8c8b5d2 commit f976625

File tree

4 files changed

+14
-28
lines changed

4 files changed

+14
-28
lines changed

Taskfile.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
version: "3"
23

34
vars:
@@ -10,6 +11,9 @@ vars:
1011
go list ./... | tr '\n' ' ' ||
1112
echo '"ERROR: Unable to discover Go packages"'
1213
)
14+
# `-ldflags` flag to use for `go build` command
15+
# TODO: define flag if required by the project, or leave empty if not needed.
16+
LDFLAGS:
1317

1418
tasks:
1519
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
@@ -44,5 +48,12 @@ tasks:
4448
desc: Run unit tests
4549
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
4650
cmds:
47-
- docker build -f testdata/Dockerfile -t go-apt-test:latest .
48-
- docker run --rm -v "$PWD":/app go-apt-test -v -short -run '{{default ".*" .GO_TEST_REGEX}}' {{default "-timeout 10m -coverpkg=./... -covermode=atomic" .GO_TEST_FLAGS}} -coverprofile=coverage_unit.txt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
51+
- |
52+
go test \
53+
-v \
54+
-short \
55+
-run '{{default ".*" .GO_TEST_REGEX}}' \
56+
{{default "-timeout 10m -coverpkg=./... -covermode=atomic" .GO_TEST_FLAGS}} \
57+
-coverprofile=coverage_unit.txt \
58+
{{.TEST_LDFLAGS}} \
59+
{{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}

apt.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ func parseDpkgQueryOutput(out []byte) []*Package {
8686

8787
// CheckForUpdates runs an apt update to retrieve new packages available
8888
// from the repositories
89+
// NOTE: it requires root privileges to run
8990
func CheckForUpdates() (output []byte, err error) {
9091
cmd := exec.Command("apt-get", "update", "-q")
9192
return cmd.CombinedOutput()

apt_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@ func TestListUpgradable(t *testing.T) {
6363
require.NoError(t, err, "running List command")
6464
}
6565

66-
func TestCheckForUpdates(t *testing.T) {
67-
out, err := CheckForUpdates()
68-
require.NoError(t, err, "running CheckForUpdate command")
69-
fmt.Printf(">>>\n%s\n<<<\n", string(out))
70-
fmt.Println("ERR:", err)
71-
}
72-
7366
func TestParseListUpgradableOutput(t *testing.T) {
7467
t.Run("edges cases", func(t *testing.T) {
7568
tests := []struct {

testdata/Dockerfile

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)