Skip to content

CSPL-4386: Extract inline YAMLs to fixtures#1801

Merged
Igor-splunk merged 4 commits into
developfrom
CSPL-4386
Apr 20, 2026
Merged

CSPL-4386: Extract inline YAMLs to fixtures#1801
Igor-splunk merged 4 commits into
developfrom
CSPL-4386

Conversation

@Igor-splunk
Copy link
Copy Markdown
Collaborator

@Igor-splunk Igor-splunk commented Mar 30, 2026

Description

Move inline yamls that are hard to work with to yamls.
We have prettified versions that are easier to work with.

Key Changes

Highlight the updates in specific files

Testing and Verification

How did you test these changes? What automated tests are added?

Related Issues

Jira tickets, GitHub issues, Support tickets...

PR Checklist

  • Code changes adhere to the project's coding standards.
  • Relevant unit and integration tests are included.
  • Documentation has been updated accordingly.
  • All tests pass locally.
  • The PR description follows the project's guidelines.

@Igor-splunk Igor-splunk requested a review from kasiakoziol April 1, 2026 14:21
@kasiakoziol
Copy link
Copy Markdown
Collaborator

Please update the PR description.

Comment thread pkg/splunk/common/urls_testingcode.go Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm.... this will be included in splunk-operator final build (it's not _test.go).

I think that most of the fixtures are used in single place - maybe we can move them close to place there they are used and then put them in _test.go so we won't put it in our build

Comment thread pkg/splunk/client/enterprise_test.go Outdated
@@ -434,7 +434,7 @@ func TestAutomateMCApplyChanges(t *testing.T) {
wantRequests = []*http.Request(append(wantRequests, request1, request2, request3, request4, request5, request6, request7, request8, request9, request10))
body := []string{
`{"links":{},"origin":"https://localhost:8089/services/server/info","updated":"2020-09-24T06:38:53+00:00","generator":{"build":"a1a6394cc5ae","version":"8.0.5"},"entry":[{"name":"server-info","id":"https://localhost:8089/services/server/info/server-info","updated":"1970-01-01T00:00:00+00:00","links":{"alternate":"/services/server/info/server-info","list":"/services/server/info/server-info"},"author":"system","acl":{"app":"","can_list":true,"can_write":true,"modifiable":false,"owner":"system","perms":{"read":["*"],"write":[]},"removable":false,"sharing":"system"},"fields":{"required":[],"optional":[],"wildcard":[]},"content":{"activeLicenseGroup":"Trial","activeLicenseSubgroup":"Production","build":"a1a6394cc5ae","cluster_label":["idxc_label"],"cpu_arch":"x86_64","eai:acl":null,"fips_mode":false,"guid":"0F93F33C-4BDA-4A74-AD9F-3FCE26C6AFF0","health_info":"green","health_version":1,"host":"splunk-default-monitoring-console-86bc9b7c8c-d96x2","host_fqdn":"splunk-default-monitoring-console-86bc9b7c8c-d96x2","host_resolved":"splunk-default-monitoring-console-86bc9b7c8c-d96x2","isForwarding":true,"isFree":false,"isTrial":true,"kvStoreStatus":"ready","licenseKeys":["5C52DA5145AD67B8188604C49962D12F2C3B2CF1B82A6878E46F68CA2812807B"],"licenseSignature":"139bf73ec92c84121c79a9b8307a6724","licenseState":"OK","license_labels":["Splunk Enterprise Splunk Analytics for Hadoop Download Trial"],"master_guid":"0F93F33C-4BDA-4A74-AD9F-3FCE26C6AFF0","master_uri":"self","max_users":4294967295,"mode":"normal","numberOfCores":1,"numberOfVirtualCores":2,"os_build":"#1 SMP Thu Sep 3 19:04:44 UTC 2020","os_name":"Linux","os_name_extended":"Linux","os_version":"4.14.193-149.317.amzn2.x86_64","physicalMemoryMB":7764,"product_type":"enterprise","rtsearch_enabled":true,"serverName":"splunk-default-monitoring-console-86bc9b7c8c-d96x2","server_roles":["license_master","cluster_search_head","search_head"],"startup_time":1600928786,"staticAssetId":"CFE3D41EE2CCD1465E8C8453F83E4ECFFF540780B4490E84458DD4A3694CE4D1","version":"8.0.5"}}],"paging":{"total":1,"perPage":30,"offset":0},"messages":[]}`,
Copy link
Copy Markdown
Collaborator

@kubabuczak kubabuczak Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it a candidate for fixture?

Comment thread pkg/splunk/client/test_helpers_test.go Outdated
@@ -0,0 +1,39 @@
// Copyright (c) 2018-2022 Splunk Inc. All rights reserved.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

@@ -0,0 +1,52 @@
// Copyright (c) 2018-2022 Splunk Inc. All rights reserved.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

func loadFixture(t *testing.T, filename string) string {
t.Helper()
path := filepath.Join("testdata", "fixtures", filename)
data, err := os.ReadFile(path)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not getting why we cannot simply embed it

@Igor-splunk Igor-splunk changed the title CSPL-4386 CSPL-4386: Extract inline YAMLs to fixtures Apr 20, 2026
@Igor-splunk Igor-splunk merged commit bfeb9b1 into develop Apr 20, 2026
51 checks passed
@Igor-splunk Igor-splunk deleted the CSPL-4386 branch April 20, 2026 16:55
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants