Skip to content

[Policy tests] Use go-ucfg to read policy test configuration files#3299

Merged
mrodm merged 4 commits intoelastic:mainfrom
mrodm:fix_reading_policy_config
Feb 23, 2026
Merged

[Policy tests] Use go-ucfg to read policy test configuration files#3299
mrodm merged 4 commits intoelastic:mainfrom
mrodm:fix_reading_policy_config

Conversation

@mrodm
Copy link
Copy Markdown
Contributor

@mrodm mrodm commented Feb 20, 2026

As skip configuration is set with tags config, those settings were ignored when reading the policy test configuration. This caused that policy tests could not be skipped.

This PR updates the method to read the configuration to use go-ucfg and go-ucfg/yaml libs. This is the same approach done for pipeline and system tests.

Example

### Current elastic-package version 0.120.0
 $ elastic-package-v0.120.0 test policy -C test/packages/parallel/httpcheck 
Run policy tests for the package
2026/02/20 13:45:43  INFO elastic-package v0.120.0 version-hash 97620231 (build time: 2026-02-18T17:17:16+01:00)
2026/02/20 13:45:43  INFO elastic-stack: 9.4.0
--- Test results for package: httpcheck - START ---
╭───────────┬─────────────┬───────────┬───────────────────┬────────┬───────────────╮
│ PACKAGE   │ DATA STREAM │ TEST TYPE │ TEST NAME         │ RESULT │  TIME ELAPSED │
├───────────┼─────────────┼───────────┼───────────────────┼────────┼───────────────┤
│ httpcheck │             │ policy    │ test-eprcheck.yml │ PASS   │ 12.894671393s │
│ httpcheck │             │ policy    │ test-skip.yml     │ PASS   │  9.005140439s │
╰───────────┴─────────────┴───────────┴───────────────────┴────────┴───────────────╯
--- Test results for package: httpcheck - END   ---

### Changes in this Pull Request

 $ elastic-package test policy -C test/packages/parallel/httpcheck 
Run policy tests for the package
2026/02/20 13:47:01  INFO elastic-package v0.120.1-0.20260219114940-03f307bc3057+dirty version-hash 03f307bc-dirty (build time: 2026-02-20T13:35:56+01:00)
2026/02/20 13:47:01  INFO elastic-stack: 9.4.0
2026/02/20 13:47:14  WARN skipping policy test for httpcheck/: Test skipped tests (details: https://github.com/elastic/elastic-package/pull/1)
--- Test results for package: httpcheck - START ---
╭───────────┬─────────────┬───────────┬───────────────────┬─────────────────────────────────────────────────────────────────────────────────┬───────────────╮
│ PACKAGE   │ DATA STREAM │ TEST TYPE │ TEST NAME         │ RESULT                                                                          │  TIME ELAPSED │
├───────────┼─────────────┼───────────┼───────────────────┼─────────────────────────────────────────────────────────────────────────────────┼───────────────┤
│ httpcheck │             │ policy    │ test-eprcheck.yml │ PASS                                                                            │ 11.769181203s │
│ httpcheck │             │ policy    │ test-skip.yml     │ SKIPPED: Test skipped tests [https://github.com/elastic/elastic-package/pull/1] │     169.388µs │
╰───────────┴─────────────┴───────────┴───────────────────┴─────────────────────────────────────────────────────────────────────────────────┴───────────────╯
--- Test results for package: httpcheck - END   ---
Done

Author's checklist

How to test this PR locally

Add to a policy test the following configuration:

skip:
  reason: This test is flaky and needs to be fixed.
  link: https://github.com/elastic/elastic-package/issues/1

Execute elastic-package policy test and this test should be skipped.

Screenshots

image

@mrodm mrodm self-assigned this Feb 20, 2026
@mrodm
Copy link
Copy Markdown
Contributor Author

mrodm commented Feb 20, 2026

test integrations

@elastic-vault-github-plugin-prod
Copy link
Copy Markdown

Created or updated PR in integrations repository to test this version. Check elastic/integrations#17493

@mrodm
Copy link
Copy Markdown
Contributor Author

mrodm commented Feb 20, 2026

/test

@elasticmachine
Copy link
Copy Markdown
Collaborator

elasticmachine commented Feb 20, 2026

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @mrodm

@mrodm mrodm marked this pull request as ready for review February 20, 2026 16:33
@mrodm mrodm requested a review from a team February 20, 2026 16:33
@mrodm mrodm merged commit 4fe4c14 into elastic:main Feb 23, 2026
3 checks passed
@mrodm mrodm deleted the fix_reading_policy_config branch February 23, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants