-
-
Notifications
You must be signed in to change notification settings - Fork 58
Add comprehensive CLI testing with CI integration and real adapter validation #3089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Apollon77 <[email protected]>
Co-authored-by: Apollon77 <[email protected]>
@copilot Please also add the test execution to the CI scripts or include it in the test commands it is correct that installing an adapter relies on working network connection but for the proof now please install a real adapter, maybe "admin" namely. Then validate that this really worked by also checking the files and created objects and states. Only that way we can also validate more. I accept for now that tests can be flaky because of this. An alternative would be to somehow to mock the "https://github.com/AlCalzone/pak" package which is used to abstract npm actions. |
Co-authored-by: Apollon77 <[email protected]>
Done! I've implemented both requested changes: CLI Tests in CI Pipeline: Added CLI test execution to Real Admin Adapter Testing: Enhanced the adapter lifecycle test to:
The tests now provide comprehensive validation of the CLI workflow with real adapter operations while maintaining resilience for CI environments with limited network access. Commit: 3624ccc
Implemented! Added CLI tests to CI pipeline and enhanced with real admin adapter testing - see latest commit 3624ccc for the comprehensive implementation that validates actual file creation, database objects, and adapter metadata. |
it('should successfully install admin adapter', async function () { | ||
// First check if adapter is already installed | ||
const listResult = await runCliCommand(['list', 'adapters']); | ||
expect(listResult.exitCode).to.equal(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Add verification here that admin is not already installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added verification that admin is not already installed before attempting installation to ensure test isolation. The test now explicitly checks that the adapter is not pre-installed with expect(listResult.stdout).to.not.include(testAdapter)
. Commit: e7753c5
|
||
if (listResult.stdout.includes(testAdapter)) { | ||
// Try to create an instance | ||
const result = await runCliCommand(['add', testAdapter, '--enabled', 'false']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verify if and when yes how many instaled are alreayd there. This command is then adding a new instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added instance count tracking before and after the add
command. The test now counts existing instances using regex matching, then verifies that exactly one new instance is created by checking afterInstanceCount === beforeInstanceCount + 1
. Commit: e7753c5
Co-authored-by: Apollon77 <[email protected]>
@copilot resolve conflicts in package-lock.json |
Co-authored-by: GermanBluefox <[email protected]>
Resolved package-lock.json conflicts by using the version from master branch. This ensures no merge conflicts when the PR is integrated back to master while maintaining dependency consistency. Commit: 2420bf5 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR implements comprehensive testing infrastructure for ioBroker CLI commands with full CI integration and real adapter testing to ensure the command-line interface works correctly in production environments.
Progress Checklist
.github/workflows/ci-tests.yml
for continuous validationnode_modules/
system.adapter.admin.0
are properly createdio-package.json
structure and adapter configurationLatest Changes
Resolved package-lock.json conflicts by adopting the version from master branch. This ensures:
The implementation provides end-to-end validation of the complete CLI workflow with actual adapter operations while maintaining compatibility with the main codebase.
Fixes #3088.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.