File tree Expand file tree Collapse file tree 4 files changed +14
-28
lines changed Expand file tree Collapse file tree 4 files changed +14
-28
lines changed Original file line number Diff line number Diff line change
1
+
1
2
version : " 3"
2
3
3
4
vars :
10
11
go list ./... | tr '\n' ' ' ||
11
12
echo '"ERROR: Unable to discover Go packages"'
12
13
)
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 :
13
17
14
18
tasks :
15
19
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
@@ -44,5 +48,12 @@ tasks:
44
48
desc : Run unit tests
45
49
dir : " {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
46
50
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}}
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ func parseDpkgQueryOutput(out []byte) []*Package {
86
86
87
87
// CheckForUpdates runs an apt update to retrieve new packages available
88
88
// from the repositories
89
+ // NOTE: it requires root privileges to run
89
90
func CheckForUpdates () (output []byte , err error ) {
90
91
cmd := exec .Command ("apt-get" , "update" , "-q" )
91
92
return cmd .CombinedOutput ()
Original file line number Diff line number Diff line change @@ -63,13 +63,6 @@ func TestListUpgradable(t *testing.T) {
63
63
require .NoError (t , err , "running List command" )
64
64
}
65
65
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
-
73
66
func TestParseListUpgradableOutput (t * testing.T ) {
74
67
t .Run ("edges cases" , func (t * testing.T ) {
75
68
tests := []struct {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments