Skip to content

Upgrade to @iobroker/testing 5.1.1, remove redundant dependencies, and integrate template tests in main test suite#1166

Merged
Apollon77 merged 9 commits intomasterfrom
copilot/fix-1165
Sep 20, 2025
Merged

Upgrade to @iobroker/testing 5.1.1, remove redundant dependencies, and integrate template tests in main test suite#1166
Apollon77 merged 9 commits intomasterfrom
copilot/fix-1165

Conversation

Copy link
Contributor

Copilot AI commented Aug 31, 2025

This PR upgrades the create-adapter tool to use @iobroker/testing 5.1.1, which now incorporates many test dev-dependencies that can be removed from generated adapter templates. Additionally, it integrates the template creation test into the main test suite and eliminates duplicate test execution in CI.

Key Changes

Dependency Management:

  • Updated @iobroker/testing dependency to latest version in generated templates (no version pinning)
  • Removed redundant test dependencies now included in @iobroker/testing 5.1.1

Testing Infrastructure:

  • Added test:templates npm script that runs the template creation test
  • Integrated template creation test into the main test suite (npm test)
  • Removed duplicate template creation test step from CI workflow to prevent running the same test twice

Documentation & Process:

  • Created migration file with detailed upgrade instructions
  • Added changelog entry referencing the migration guide
  • Updated .copilot-instructions.md to strengthen requirements for migration files and changelog entries

Dependencies Removed

The following dependencies are no longer added to generated adapter package.json files since they're now included in @iobroker/testing 5.1.1:

Runtime dependencies:

  • chai (^4.5.0)
  • chai-as-promised (^7.1.2)
  • mocha (^11.7.1)
  • sinon (^19.0.5)
  • sinon-chai (^3.7.0)
  • proxyquire (^2.1.3)

Type definitions:

  • @types/chai (^4.3.20)
  • @types/chai-as-promised (^8.0.2)
  • @types/mocha (^10.0.10)
  • @types/sinon (^17.0.4)
  • @types/sinon-chai (^3.2.12)
  • @types/proxyquire (^1.3.31)

Impact

  • Generated adapters have cleaner package.json files with fewer dependencies
  • All testing functionality remains unchanged as dependencies are provided by @iobroker/testing
  • Template creation testing is now part of the standard development workflow
  • Reduced dependency management overhead for adapter developers
  • Better alignment between local testing and CI pipeline with no duplicate test execution
  • @iobroker/testing dependency now automatically resolves to the latest available version

Fixes #1165.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…5.1.x

Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copilot AI changed the title [WIP] Upgrade to @iobroker/testing 5.1.x Upgrade to @iobroker/testing 5.1.x and remove redundant test dependencies Aug 31, 2025
Copilot AI requested a review from Apollon77 August 31, 2025 20:45
@Apollon77
Copy link
Collaborator

@copilot Please upgrade the iobroker/testing dependency to 5.1.1 to see if CI tests work now

Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 31, 2025

@copilot Please upgrade the iobroker/testing dependency to 5.1.1 to see if CI tests work now

Updated @iobroker/testing dependency to 5.1.1 in templates/package.json.ts and regenerated all baseline test files. All tests pass with the new version requirement. Commit dd0f309.

Copilot AI changed the title Upgrade to @iobroker/testing 5.1.x and remove redundant test dependencies Upgrade to @iobroker/testing 5.1.1 and remove redundant test dependencies Aug 31, 2025
@Apollon77
Copy link
Collaborator

@copilot Please add to your instructions that the "https://github.com/ioBroker/create-adapter/blob/master/.github/test_template_creation.sh" file should also be executed as part of the tests. This is also executed by the CI tests and was failing before the version increase to 5.1.1

@Apollon77 Apollon77 marked this pull request as ready for review August 31, 2025 21:35
@Apollon77
Copy link
Collaborator

@copilot Please also add a migration file and a changelog entry to the PR.

And please finally update your instructions so that this is never forgotten to do!

…est suite

Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 31, 2025

@copilot Please add to your instructions that the "https://github.com/ioBroker/create-adapter/blob/master/.github/test_template_creation.sh" file should also be executed as part of the tests. This is ...

Added test:templates script to package.json and included it in the main test suite. The template creation test is now executed when running npm test, ensuring consistency with CI testing. Commit 727afaf.

Copilot AI changed the title Upgrade to @iobroker/testing 5.1.1 and remove redundant test dependencies Upgrade to @iobroker/testing 5.1.1, remove redundant dependencies, and include template tests in main test suite Aug 31, 2025
@Apollon77
Copy link
Collaborator

@copilot By incorporating the template generation tests into the "npm run test" the CI now executes this twice because the script is still executed also alone. Please remove the (now) separate test step

…grade, update PR requirements

Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 31, 2025

@copilot Please also add a migration file and a changelog entry to the PR.

And please finally update your instructions so that this is never forgotten to do!

Added migration file at docs/updates/20250831_iobroker_testing_51.md with detailed upgrade instructions and changelog entry referencing the migration guide. Also updated .copilot-instructions.md to make migration files and changelog entries a REQUIRED part of all PRs, with clearer formatting and explicit requirements to ensure this is never forgotten. Commit da67959.

Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 31, 2025

@copilot By incorporating the template generation tests into the "npm run test" the CI now executes this twice because the script is still executed also alone. Please remove the (now) separate test st...

Removed the duplicate template creation test step from the CI workflow. The template generation test now only runs once as part of the main test suite (npm test). Commit c4e7e6f.

Copilot AI changed the title Upgrade to @iobroker/testing 5.1.1, remove redundant dependencies, and include template tests in main test suite Upgrade to @iobroker/testing 5.1.1, remove redundant dependencies, and integrate template tests in main test suite Aug 31, 2025
Copilot AI requested a review from Apollon77 August 31, 2025 21:50
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
...([
// testing and translations are always required
"@iobroker/testing",
"@iobroker/testing@^5.1.1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot No need to specify the exact version here, this should automatically be resolved to the latest available which is ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the exact version specification from @iobroker/testing dependency. It now automatically resolves to the latest available version. Commit 8a597b1.

…plates

Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copilot AI requested a review from Apollon77 August 31, 2025 22:05
@Apollon77 Apollon77 merged commit 7e95bb3 into master Sep 20, 2025
9 checks passed
@Apollon77 Apollon77 deleted the copilot/fix-1165 branch September 20, 2025 12:09
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.

Upgrade to @iobroker/testing 5.1.x

2 participants