Skip to content

Add automated pipeline testing framework for tw pipelines#286

Draft
debasishbsws wants to merge 2 commits intochainguard-dev:mainfrom
debasishbsws:add-test-for-tw-2
Draft

Add automated pipeline testing framework for tw pipelines#286
debasishbsws wants to merge 2 commits intochainguard-dev:mainfrom
debasishbsws:add-test-for-tw-2

Conversation

@debasishbsws
Copy link
Member

Introduces a Go-based test runner that auto-generates Melange test configs from declarative YAML test cases, eliminating manual test file duplication.

Key additions:

  • pipeline-runner/: Go CLI tool that parses test cases, generates Melange configs, executes tests, and reports failures
  • Test case YAML format with expect_pass for positive/negative testing
  • Initial test suites for contains-files, docs, emptypackage, and metapackage pipelines
  • Debug and verbose logging modes for troubleshooting

Benefits:

  • 1:1 mapping: one test case = one package + one expected outcome
  • Real package testing against actual Wolfi packages
  • Automated validation with detailed failure reporting
  • Reduces test maintenance burden from N config files to single test suite definitions

This will not replace the manual test infra we are adding here, but complements it for easier configuration for normal everyday package test.

Introduces a Go-based test runner that auto-generates Melange test configs from declarative YAML test cases, eliminating manual test file duplication.

Key additions:
- pipeline-runner/: Go CLI tool that parses test cases, generates Melange configs, executes tests, and reports failures
- Test case YAML format with expect_pass for positive/negative testing
- Initial test suites for contains-files, docs, emptypackage, and metapackage pipelines
- Debug and verbose logging modes for troubleshooting
- Generated configs auto-gitignored to keep source control clean

Benefits:
- 1:1 mapping: one test case = one package + one expected outcome
- Real package testing against actual Wolfi packages
- Automated validation with detailed failure reporting
- Reduces test maintenance burden from N config files to single test suite definitions

See tests/AUTOGEN-TESTS.md for complete documentation on architecture, usage, and test creation guidelines.

Signed-off-by: Debasish Biswas <debasishbsws.dev@gmail.com>
@@ -0,0 +1,23 @@
name: Contains-files pipeline validation tests
Copy link
Contributor

Choose a reason for hiding this comment

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

ok, so assuming we have 2 flavors of test: manual and autogenerated, maybe it makes sense to separate them in different directores:

test/manual/testcases/
test/autogen/testcases/

We can put the pipeline-runner code inside test/autogen/ as well, so everything is self-contained.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am thinking about this structure

tests/
├── manual/                    # Manual tests (full melange YAML)
│   └── header-check.yaml
├── docs.yaml                  # Suite tests (declarative format)
├── contains-files.yaml
├── emptypackage.yaml
├── metapackage.yaml
├── runner/                    # Test runner tool (infrastructure)
│   ├── main.go
│   ├── go.mod
│   └── pipeline-runner
├── packages/                  # Build artifacts (gitignored)
├── generated/                 # Auto-generated configs (gitignored)
├── README.md
└── .gitignore

Copy link
Member Author

Choose a reason for hiding this comment

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

the normal autogen is the default test resides inside the tests folder and the manual is in a seperate folder

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.

2 participants