Skip to content

Commit

Permalink
[chore][cmd/configschema] Fix and re-enable resolver tests on Windows (
Browse files Browse the repository at this point in the history
…open-telemetry#29343)

**Description:**
Part 3 of open-telemetry#28679 these tests needed some fixes, related to file paths,
to be re-enabled on Windows.

**Link to tracking Issue:**
Related to open-telemetry#28679

**Testing:**
Local test run on Windows for the affected packages.

**Documentation:**
N/A
  • Loading branch information
pjanotti committed Nov 20, 2023
1 parent 875225e commit 38db557
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmd/configschema/resolver_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

// Skip tests on Windows temporarily, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/11451
//go:build !windows
// +build !windows

package configschema

import (
Expand Down Expand Up @@ -48,7 +44,7 @@ func TestTypeToPackagePath_Local(t *testing.T) {

func TestTypeToPackagePath_External(t *testing.T) {
packageDir := testTypeToPackagePath(t, otlpreceiver.Config{})
assert.Contains(t, packageDir, "pkg/mod/go.opentelemetry.io/collector/receiver@")
assert.Contains(t, packageDir, filepath.Join("pkg", "mod", "go.opentelemetry.io", "collector", "receiver@"))
}

func TestTypeToPackagePath_Error(t *testing.T) {
Expand All @@ -59,7 +55,7 @@ func TestTypeToPackagePath_Error(t *testing.T) {

func TestTypeToProjectPath(t *testing.T) {
dir := testDR().ReflectValueToProjectPath(reflect.ValueOf(&redisreceiver.Config{}))
assert.Equal(t, "../../receiver/redisreceiver", dir)
assert.Equal(t, filepath.Join("..", "..", "receiver", "redisreceiver"), dir)
}

func TestTypetoProjectPath_External(t *testing.T) {
Expand Down

0 comments on commit 38db557

Please sign in to comment.