Add check config integration test#316
Open
RiSKeD wants to merge 3 commits into
Open
Conversation
Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
The config validator now rejects main modules with args set, since main modules receive their arguments from the client at runtime. The dummy status command incorrectly had static args defined on the main module. Remove the args; they can be passed on the command line when invoking dutctl. Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
Build the dutagent binary in TestMain and run --check-config against every module example config file, asserting exit 0 and the expected "Configuration is valid" output. Regression coverage for the GPIO --check-config panic and the requirement that all shipped example configs are kept valid. Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
There was a problem hiding this comment.
Pull request overview
Adds an integration test to ensure dutagent --check-config successfully validates all shipped example module configs (regression coverage for the GPIO-related crash reported in #290), and updates example YAMLs to match current validation rules/module IDs.
Changes:
- Add an integration test that builds
dutagentand runs--check-configagainst every*-example-cfg.ymlunderpkg/module/*/. - Fix IPMI example config to reference the registered module ID (
ipmi). - Remove invalid
argsusage from thedummy-statusmain module example.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/integration/dutagent/checkconfig_test.go | Builds dutagent and validates all example configs via --check-config, asserting clean exit and expected output. |
| pkg/module/ipmi/ipmi-example-cfg.yml | Updates example to use the correct module name (ipmi). |
| pkg/module/dummy/dummy-example-cfg.yml | Removes invalid args from a main module example so config validation passes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #290