From 5e1193f76a211dd0a54fc1d158f53b20d7a405d9 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 18 Apr 2024 08:55:02 -0600 Subject: [PATCH 1/6] Update windows tests component groups --- .github/workflows/build-and-test-windows.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test-windows.yml b/.github/workflows/build-and-test-windows.yml index c049aa5159ab..39ca6cf2871d 100644 --- a/.github/workflows/build-and-test-windows.yml +++ b/.github/workflows/build-and-test-windows.yml @@ -25,16 +25,22 @@ concurrency: jobs: windows-unittest-matrix: strategy: + fail-fast: false matrix: group: - receiver-0 - receiver-1 + - receiver-2 + - receiver-3 - processor - - exporter + - exporter-0 + - exporter-1 - extension + - connector - internal - pkg - - cmd + - cmd-0 + - cmd-1 - other runs-on: windows-latest if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push' || github.event_name == 'merge_group') }} @@ -45,8 +51,7 @@ jobs: GOMEMLIMIT: 2GiB steps: - uses: actions/checkout@v4 - - if: matrix.group == 'receiver-0' - name: install IIS + - name: install IIS run: Install-WindowsFeature -name Web-Server -IncludeManagementTools - uses: actions/setup-go@v5 with: @@ -61,9 +66,6 @@ jobs: ~\go\pkg\mod ~\AppData\Local\go-build key: go-build-cache-${{ runner.os }}-${{ matrix.group }}-go-${{ hashFiles('**/go.sum') }} - - if: matrix.group == 'cmd' - name: Increasing GOTEST_TIMEOUT for group 'cmd' - run: echo "GOTEST_TIMEOUT=1200s" >> $Env:GITHUB_ENV - name: Run Unit tests run: make -j2 gotest GROUP=${{ matrix.group }} windows-unittest: From fd7df991b1481bf9a9d004cf893419719d367554 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:32:20 -0600 Subject: [PATCH 2/6] Skip tests --- receiver/sqlserverreceiver/queries_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/receiver/sqlserverreceiver/queries_test.go b/receiver/sqlserverreceiver/queries_test.go index 3fc99f2e794a..515d7c8bbc69 100644 --- a/receiver/sqlserverreceiver/queries_test.go +++ b/receiver/sqlserverreceiver/queries_test.go @@ -6,12 +6,17 @@ package sqlserverreceiver import ( "os" "path" + "runtime" "testing" "github.com/stretchr/testify/require" ) func TestQueryIODBWithoutInstanceName(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Test is failing on Windows, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/32519") + } + expected, err := os.ReadFile(path.Join("./testdata", "databaseIOQueryWithoutInstanceName.txt")) require.NoError(t, err) @@ -21,6 +26,10 @@ func TestQueryIODBWithoutInstanceName(t *testing.T) { } func TestQueryIODBWithInstanceName(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Test is failing on Windows, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/32519") + } + expected, err := os.ReadFile(path.Join("./testdata", "databaseIOQueryWithInstanceName.txt")) require.NoError(t, err) From 27bf78cfbd77cba4d27293711ef8e1fa76e39d95 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 18 Apr 2024 10:35:20 -0600 Subject: [PATCH 3/6] Update windowseventlog test config --- receiver/windowseventlogreceiver/metadata.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/receiver/windowseventlogreceiver/metadata.yaml b/receiver/windowseventlogreceiver/metadata.yaml index cbf02a60f6d1..4a69d18fd8d0 100644 --- a/receiver/windowseventlogreceiver/metadata.yaml +++ b/receiver/windowseventlogreceiver/metadata.yaml @@ -12,3 +12,5 @@ status: tests: config: + start_at: end + channel: application \ No newline at end of file From e933a0968b3df2110c24cba8ffd831571b59614c Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:10:17 -0600 Subject: [PATCH 4/6] Fix windowsperfcounter test --- receiver/windowsperfcountersreceiver/factory_windows.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/receiver/windowsperfcountersreceiver/factory_windows.go b/receiver/windowsperfcountersreceiver/factory_windows.go index 974ef60a032f..611d1bd50cf1 100644 --- a/receiver/windowsperfcountersreceiver/factory_windows.go +++ b/receiver/windowsperfcountersreceiver/factory_windows.go @@ -12,6 +12,8 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/scraperhelper" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowsperfcountersreceiver/internal/metadata ) // createMetricsReceiver creates a metrics receiver based on provided config. @@ -25,7 +27,7 @@ func createMetricsReceiver( scraper := newScraper(oCfg, params.TelemetrySettings) scrp, err := scraperhelper.NewScraper( - params.ID.String(), + metadata.Type.String(), scraper.scrape, scraperhelper.WithStart(scraper.start), scraperhelper.WithShutdown(scraper.shutdown), From 4ab8ef1a9c5358d8368c94f6b12bd277faeaf082 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:14:21 -0600 Subject: [PATCH 5/6] Update receiver/windowsperfcountersreceiver/factory_windows.go Co-authored-by: Curtis Robert --- receiver/windowsperfcountersreceiver/factory_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/windowsperfcountersreceiver/factory_windows.go b/receiver/windowsperfcountersreceiver/factory_windows.go index 611d1bd50cf1..10eaba63c3ea 100644 --- a/receiver/windowsperfcountersreceiver/factory_windows.go +++ b/receiver/windowsperfcountersreceiver/factory_windows.go @@ -13,7 +13,7 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/scraperhelper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowsperfcountersreceiver/internal/metadata + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowsperfcountersreceiver/internal/metadata" ) // createMetricsReceiver creates a metrics receiver based on provided config. From f899222a11bf0f93b3a1c9987fb9841ff1887ded Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:16:00 -0600 Subject: [PATCH 6/6] Update receiver/windowseventlogreceiver/metadata.yaml Co-authored-by: Curtis Robert --- receiver/windowseventlogreceiver/metadata.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/windowseventlogreceiver/metadata.yaml b/receiver/windowseventlogreceiver/metadata.yaml index 4a69d18fd8d0..a3eaf7dc6612 100644 --- a/receiver/windowseventlogreceiver/metadata.yaml +++ b/receiver/windowseventlogreceiver/metadata.yaml @@ -13,4 +13,4 @@ status: tests: config: start_at: end - channel: application \ No newline at end of file + channel: application