Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken lifecycle test in several components #30563

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/opampsupervisor/supervisor/supervisor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package supervisor

import (
"bytes"
"os"
"sync/atomic"
"testing"
Expand Down Expand Up @@ -52,6 +53,7 @@ func Test_composeEffectiveConfig(t *testing.T) {

expectedConfig, err := os.ReadFile("../testdata/collector/effective_config.yaml")
require.NoError(t, err)
expectedConfig = bytes.ReplaceAll(expectedConfig, []byte("\r\n"), []byte("\n"))

require.True(t, configChanged)
require.Equal(t, string(expectedConfig), s.effectiveConfig.Load().(string))
Expand Down
3 changes: 0 additions & 3 deletions receiver/podmanreceiver/libpod_client.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:build !windows
// +build !windows

package podmanreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver"

import (
Expand Down
3 changes: 0 additions & 3 deletions receiver/podmanreceiver/libpod_data.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:build !windows
// +build !windows

package podmanreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver"

import "time"
Expand Down
3 changes: 0 additions & 3 deletions receiver/podmanreceiver/metrics.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:build !windows
// +build !windows

package podmanreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver"

import (
Expand Down
3 changes: 0 additions & 3 deletions receiver/podmanreceiver/podman_connection.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:build !windows
// +build !windows

package podmanreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver"

import (
Expand Down
47 changes: 47 additions & 0 deletions receiver/podmanreceiver/podman_windows.go
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make changes to mdatagen to not run these tests on Windows instead of allowing the receiver to start on Windows. Allowing the receiver to silently start on Windows will lead to a more confusing user experience since it makes it less obvious that Windows isn't a supported platform.

In my opinion we should tackle this issue to resolve the problems with the Windows tests: #30044.

Copy link
Contributor Author

@fatsheep9146 fatsheep9146 Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I also talk about this idea in slacks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a pr to solve this problem by adding supported_platforms
#30640
close this

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package podmanreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver"

import (
"context"
"net/url"

"go.uber.org/zap"
)

type clientFactory func(logger *zap.Logger, cfg *Config) (PodmanClient, error)

type PodmanClient interface {
ping(context.Context) error
stats(context.Context, url.Values) ([]containerStats, error)
list(context.Context, url.Values) ([]container, error)
events(context.Context, url.Values) (<-chan event, <-chan error)
}

type ContainerScraper struct {
}

func newContainerScraper(engineClient PodmanClient, logger *zap.Logger, config *Config) *ContainerScraper {
return &ContainerScraper{}
}

func (pc *ContainerScraper) getContainers() []container {
cs := make([]container, 0)
return cs
}

func (pc *ContainerScraper) loadContainerList(ctx context.Context) error {
return nil
}

func (pc *ContainerScraper) fetchContainerStats(ctx context.Context, c container) (containerStats, error) {
return containerStats{}, nil
}

func (pc *ContainerScraper) persistContainer(c container) {
}

func (pc *ContainerScraper) containerEventLoop(ctx context.Context) {

}
3 changes: 0 additions & 3 deletions receiver/podmanreceiver/receiver.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:build !windows
// +build !windows

package podmanreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver"

import (
Expand Down
22 changes: 0 additions & 22 deletions receiver/podmanreceiver/receiver_windows.go

This file was deleted.

20 changes: 0 additions & 20 deletions receiver/podmanreceiver/receiver_windows_test.go

This file was deleted.

Loading