Skip to content

Commit

Permalink
[chore] Update windows tests component groups (#32518)
Browse files Browse the repository at this point in the history
**Description:**
Someone, and we may never know who, forgot to update the windows test
groups when they created
#30901

Fixes
#32508

---------

Co-authored-by: Curtis Robert <[email protected]>
  • Loading branch information
TylerHelmuth and crobert-1 authored Apr 18, 2024
1 parent 68b7f51 commit 169e1c2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/build-and-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand All @@ -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:
Expand All @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions receiver/sqlserverreceiver/queries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions receiver/windowseventlogreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ status:

tests:
config:
start_at: end
channel: application
4 changes: 3 additions & 1 deletion receiver/windowsperfcountersreceiver/factory_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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),
Expand Down

0 comments on commit 169e1c2

Please sign in to comment.