Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into updatecli_89a5aea2e…
Browse files Browse the repository at this point in the history
…d724df7f43cb772297a075121470c26674e8e5964d3e91292f1d331
  • Loading branch information
cmacknz committed Jan 8, 2024
2 parents 71c2803 + 44721e5 commit 01e9cf4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ linters-settings:

nolintlint:
# Enable to ensure that nolint directives are all used. Default is true.
allow-unused: false
allow-unused: true
# Disable to ensure that nolint directives don't have a leading space. Default is true.
allow-leading-space: false
# Exclude following linters from requiring an explanation. Default is [].
Expand Down
6 changes: 3 additions & 3 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Elastic Agent System Metrics
Copyright 2022-2023 Elasticsearch BV
Copyright 2022-2024 Elasticsearch BV

This product includes software developed by The Apache Software
Foundation (http://www.apache.org/).
Expand Down Expand Up @@ -2104,11 +2104,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--------------------------------------------------------------------------------
Dependency : github.com/cyphar/filepath-securejoin
Version: v0.2.3
Version: v0.2.4
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/cyphar/filepath-securejoin@v0.2.3/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/cyphar/filepath-securejoin@v0.2.4/LICENSE:

Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved.
Copyright (C) 2017 SUSE LLC. All rights reserved.
Expand Down
11 changes: 7 additions & 4 deletions metric/system/process/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func TestNetworkFilter(t *testing.T) {

_, exists := data.GetValue("network.ip.Forwarding")
require.NoError(t, exists, "filter did not preserve key")
ipMetrics, exists := data.GetValue("network.ip")
ipMetrics, _ := data.GetValue("network.ip")
require.Equal(t, 1, len(ipMetrics.(map[string]interface{})))
}

Expand All @@ -196,7 +196,10 @@ func TestFilter(t *testing.T) {

procData, _, err := testConfig.Get()
assert.NoError(t, err, "GetOne")
assert.Len(t, procData, 2)
// the total count of processes can either be one or two,
// depending on if the highest-mem-usage process and
// highest-cpu-usage process are the same.
assert.GreaterOrEqual(t, len(procData), 1)

testZero := Stats{
Procs: []string{".*"},
Expand Down Expand Up @@ -581,7 +584,7 @@ func TestIncludeTopProcesses(t *testing.T) {
//go:generate docker run --rm -v ./testdata:/app --entrypoint g++ docker.elastic.co/beats-dev/golang-crossbuild:1.21.0-main -pthread -std=c++11 -o /app/threads /app/threads.cpp
//go:generate docker run --rm -v ./testdata:/app --entrypoint o64-clang++ docker.elastic.co/beats-dev/golang-crossbuild:1.21.0-darwin -pthread -std=c++11 -o /app/threads-darwin /app/threads.cpp
//go:generate docker run --rm -v ./testdata:/app --entrypoint x86_64-w64-mingw32-g++-posix docker.elastic.co/beats-dev/golang-crossbuild:1.21.0-main -pthread -std=c++11 -o /app/threads.exe /app/threads.cpp
func runThreads(t *testing.T) *exec.Cmd {
func runThreads(t *testing.T) *exec.Cmd { //nolint: deadcode,structcheck,unused // needed by other platforms
t.Helper()

supportedPlatforms := []string{"linux/amd64", "darwin/amd64", "windows/amd64"}
Expand Down Expand Up @@ -654,7 +657,7 @@ func initTestResolver() (Stats, error) {
return testConfig, err
}

func sliceContains(s []string, e string) bool {
func sliceContains(s []string, e string) bool { //nolint: deadcode,structcheck,unused // needed by other platforms
for _, v := range s {
if e == v {
return true
Expand Down

0 comments on commit 01e9cf4

Please sign in to comment.