Skip to content

Commit

Permalink
Update snapshots and fixtures to match Logstash 8.15 (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuskoman authored Oct 9, 2024
1 parent 8a41fef commit 771ee8b
Show file tree
Hide file tree
Showing 8 changed files with 446 additions and 285 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ clean-elasticsearch:
update-readme-descriptions:
./scripts/add_descriptions_to_readme.sh

#: Updates snapshot for test data and runs tests
update-snapshots:
UPDATE_SNAPS=true go test ./...

#: Upgrades all dependencies
upgrade-dependencies:
go get -u ./...
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ All configuration variables can be checked in the [config directory](./config/).
- `make helm-readme`: Generates Helm chart README.md file.
- `make clean-elasticsearch`: Cleans Elasticsearch data, works only with default ES port. The command may take a very long time to complete.
- `make update-readme-descriptions`: Update Makefile descriptions in main README.md.
- `make update-snapshots`: Updates snapshot for test data and runs tests.
- `make upgrade-dependencies`: Upgrades all dependencies.
- `make help`: Shows info about available commands.

Expand Down
6 changes: 3 additions & 3 deletions collectors/nodestats/nodestats_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func TestCollectNotNil(t *testing.T) {
"logstash_stats_pipeline_plugin_events_queue_push_duration",
"logstash_stats_pipeline_plugin_documents_successes",
"logstash_stats_pipeline_plugin_documents_non_retryable_failures",
"logstash_stats_pipeline_plugin_bulk_requests_errors",
"logstash_stats_pipeline_plugin_bulk_requests_responses",
"logstash_stats_pipeline_plugin_bulk_requests_errors",
"logstash_stats_pipeline_plugin_bulk_requests_responses",
"logstash_stats_process_cpu_percent",
"logstash_stats_process_cpu_total_millis",
"logstash_stats_process_cpu_load_average_1m",
Expand All @@ -109,7 +109,7 @@ func TestCollectNotNil(t *testing.T) {
var foundMetrics []string
for metric := range ch {
if metric == nil {
t.Errorf("expected metric %s not to be nil", metric.Desc().String())
t.Error("Expected metric not to be nil")
}

foundMetricDesc := metric.Desc().String()
Expand Down
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "3.8"
services:
logstash:
image: docker.elastic.co/logstash/logstash:8.14.3
image: docker.elastic.co/logstash/logstash:8.15.0
restart: unless-stopped
volumes:
- logstash-data:/usr/share/logstash/data
Expand Down Expand Up @@ -42,7 +41,7 @@ services:
timeout: 10s
retries: 8
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.3
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.0
restart: unless-stopped
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
Expand Down
16 changes: 8 additions & 8 deletions fetcher/responses/__snapshots__/nodeinfo_response_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
[TestNodeInfoResponseStructure - 1]
Unmarshalled NodeInfoResponse
responses.NodeInfoResponse{
Host: "9e6e14cf5532",
Version: "8.6.1",
Host: "814a8393fbd5",
Version: "8.15.0",
HTTPAddress: "0.0.0.0:9600",
ID: "a2c7110e-5ccf-4226-bc9b-e773710e66a0",
Name: "9e6e14cf5532",
EphemeralID: "4a2ee04f-2733-4eaa-887d-675bad27f07c",
ID: "690de5cc-deb1-48d9-ba02-d4ec1b22e62a",
Name: "814a8393fbd5",
EphemeralID: "eb4d9042-5642-4e21-bb8d-27454b81c5bc",
Status: "green",
Snapshot: false,
Pipeline: struct { Workers int "json:\"workers\""; BatchSize int "json:\"batch_size\""; BatchDelay int "json:\"batch_delay\"" }{Workers:16, BatchSize:125, BatchDelay:50},
BuildDate: "2023-01-24T10:41:55+00:00",
BuildSHA: "6a248b5091c490f09460db5651e5239d903b97cf",
Pipeline: struct { Workers int "json:\"workers\""; BatchSize int "json:\"batch_size\""; BatchDelay int "json:\"batch_delay\"" }{Workers:10, BatchSize:125, BatchDelay:50},
BuildDate: "2024-07-24T09:37:48+00:00",
BuildSHA: "46b996c24da17cdc7a16bc3037edab5c6132ccd0",
BuildSnapshot: false,
}
---
182 changes: 105 additions & 77 deletions fetcher/responses/__snapshots__/nodestats_response_test.snap

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions fixtures/node_info.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"host": "9e6e14cf5532",
"version": "8.6.1",
"host": "814a8393fbd5",
"version": "8.15.0",
"http_address": "0.0.0.0:9600",
"id": "a2c7110e-5ccf-4226-bc9b-e773710e66a0",
"name": "9e6e14cf5532",
"ephemeral_id": "4a2ee04f-2733-4eaa-887d-675bad27f07c",
"id": "690de5cc-deb1-48d9-ba02-d4ec1b22e62a",
"name": "814a8393fbd5",
"ephemeral_id": "eb4d9042-5642-4e21-bb8d-27454b81c5bc",
"status": "green",
"snapshot": false,
"pipeline": {
"workers": 16,
"workers": 10,
"batch_size": 125,
"batch_delay": 50
},
"build_date": "2023-01-24T10:41:55+00:00",
"build_sha": "6a248b5091c490f09460db5651e5239d903b97cf",
"build_date": "2024-07-24T09:37:48+00:00",
"build_sha": "46b996c24da17cdc7a16bc3037edab5c6132ccd0",
"build_snapshot": false
}
Loading

0 comments on commit 771ee8b

Please sign in to comment.