Skip to content

Commit

Permalink
add windows integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum committed Oct 17, 2024
1 parent bbcfa11 commit a867a2d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/integration-tests-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Integration Tests Windows
on:
# Run tests on main just so the module and build cache can be saved and used
# in PRs. This speeds up the time it takes to test PRs dramatically.
# (More information on https://docs.github.com/en/[email protected]/actions/using-workflows/caching-dependencies-to-speed-up-workflows)
push:
branches:
- main
pull_request:
jobs:
run_tests:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Run tests
run: make integration-test
23 changes: 23 additions & 0 deletions internal/cmd/integration-tests/tests/windows/config.alloy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
prometheus.exporter.windows "default" { }

prometheus.scrape "default" {
targets = prometheus.exporter.windows.default.targets
forward_to = [prometheus.remote_write.default.receiver]
scrape_interval = "1s"
scrape_timeout = "500ms"
}

prometheus.remote_write "default" {
endpoint {
url = "http://localhost:9009/api/v1/push"
metadata_config {
send_interval = "1s"
}
queue_config {
max_samples_per_send = 100
}
}
external_labels = {
test_name = "win_metrics",
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//go:build windows

package main

import (
"testing"

"github.com/grafana/alloy/internal/cmd/integration-tests/common"
)

func TestWindowsMetrics(t *testing.T) {
var winMetrics = []string{
"windows_cpu_logical_processor", // cpu
"windows_cs_logical_processors", // cs
"windows_logical_disk_info", // logical_disk
"windows_net_bytes_received_total", // net
"windows_os_info", // os
"windows_service_info", // service
"windows_system_processes", // system
}
common.MimirMetricsTest(t, winMetrics, []string{}, "win_metrics")
}

0 comments on commit a867a2d

Please sign in to comment.