Skip to content

Commit da7a0eb

Browse files
authored
Merge branch 'main' into ci/fix-post-dependabot
2 parents 4651571 + fd86b05 commit da7a0eb

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

magefile.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
"github.com/elastic/elastic-agent/dev-tools/mage/otel"
3838

3939
"github.com/jedib0t/go-pretty/v6/table"
40-
"github.com/otiai10/copy"
40+
filecopy "github.com/otiai10/copy"
4141

4242
"github.com/elastic/elastic-agent/dev-tools/devmachine"
4343
"github.com/elastic/elastic-agent/dev-tools/mage"
@@ -434,7 +434,11 @@ func (Build) TestBinaries() error {
434434
}
435435

436436
outputName := filepath.Join(pkg, binary)
437-
err := devtools.Run(nil, nil, os.Stderr, "go", pkg, "build", "-v", "-o", outputName, pkg)
437+
finalArgs := make([]string, len(args))
438+
copy(finalArgs, args)
439+
finalArgs = append(finalArgs, "-o", outputName, filepath.Join(pkg))
440+
441+
err := RunGo(finalArgs...)
438442
if err != nil {
439443
return err
440444
}
@@ -1822,8 +1826,8 @@ func useDRAAgentBinaryForPackage(ctx context.Context, manifestURL string, versio
18221826

18231827
log.Printf("copying %q to %q", srcBinaryPath, dstBinaryPath)
18241828

1825-
err = copy.Copy(srcBinaryPath, dstBinaryPath, copy.Options{
1826-
PermissionControl: copy.PerservePermission,
1829+
err = filecopy.Copy(srcBinaryPath, dstBinaryPath, filecopy.Options{
1830+
PermissionControl: filecopy.PerservePermission,
18271831
})
18281832
if err != nil {
18291833
return fmt.Errorf("copying %q to %q: %w", srcBinaryPath, dstBinaryPath, err)

testing/integration/ess/container_cmd_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,12 @@ func TestContainerCMDAgentMonitoringRuntimeExperimental(t *testing.T) {
550550
}
551551
t.Logf("Component ID: %s, version info: %s, runtime: %s", comp.ID, comp.VersionInfo.Name, compRuntime)
552552
switch comp.ID {
553-
case "beat/metrics-monitoring", "filestream-monitoring", "http/metrics-monitoring", "prometheus/metrics-monitoring":
553+
case "beat/metrics-monitoring", "filestream-monitoring", "prometheus/metrics-monitoring":
554554
// Monitoring components should use the expected runtime
555555
assert.Equalf(t, tc.expectedRuntimeName, compRuntime, "expected correct runtime name for monitoring component %s with id %s", comp.Name, comp.ID)
556+
case "http/metrics-monitoring":
557+
// The comp.VersionInfo.Name for this component is empty at times.
558+
// See https://github.com/elastic/elastic-agent/issues/11162.
556559
default:
557560
// Non-monitoring components should use the default runtime
558561
assert.Equalf(t, string(component.DefaultRuntimeManager), compRuntime, "expected default runtime for non-monitoring component %s with id %s", comp.Name, comp.ID)
@@ -671,9 +674,12 @@ func TestContainerCMDAgentMonitoringRuntimeExperimentalPolicy(t *testing.T) {
671674
}
672675
t.Logf("Component ID: %s, version info: %s, runtime: %s", comp.ID, comp.VersionInfo.Name, compRuntime)
673676
switch comp.ID {
674-
case "beat/metrics-monitoring", "filestream-monitoring", "http/metrics-monitoring", "prometheus/metrics-monitoring":
677+
case "beat/metrics-monitoring", "filestream-monitoring", "prometheus/metrics-monitoring":
675678
// Monitoring components should use the expected runtime
676679
assert.Equalf(t, tc.expectedRuntimeName, compRuntime, "unexpected runtime name for monitoring component %s with id %s", comp.Name, comp.ID)
680+
case "http/metrics-monitoring":
681+
// The comp.VersionInfo.Name for this component is empty at times.
682+
// See https://github.com/elastic/elastic-agent/issues/11162.
677683
default:
678684
// Non-monitoring components should use the default runtime
679685
assert.Equalf(t, string(component.DefaultRuntimeManager), compRuntime, "expected default runtime for non-monitoring component %s with id %s", comp.Name, comp.ID)

0 commit comments

Comments
 (0)