Skip to content
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

[shelly] Add test coverage for thing type mapping #17040

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

jlaur
Copy link
Contributor

@jlaur jlaur commented Jul 10, 2024

This introduces some initial test coverage related to thing type and API mapping:

  • Service name/device type → Thing type
  • Thing type → Gen1/Gen2/BLU

The intention is to document the current logic and to reduce risk when refactoring this logic.

Related to #17011

@jlaur jlaur added the test label Jul 10, 2024
@jlaur jlaur requested a review from markus7017 as a code owner July 10, 2024 22:55
@jlaur jlaur added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Jul 11, 2024
@markus7017
Copy link
Contributor

cool, thanks for the effort. I didn't checked that all types are in, but what I understand is that valid combinations are verified as well as invalid combos?

LGTM

@lsiepel lsiepel merged commit 8c392da into openhab:main Jul 12, 2024
5 checks passed
@lsiepel lsiepel added this to the 4.3 milestone Jul 12, 2024
@jlaur
Copy link
Contributor Author

jlaur commented Jul 13, 2024

what I understand is that valid combinations are verified as well as invalid combos?

I'm not sure what you mean by invalid combos, but I don't think so. The tests verify that the ThingUID returned by ShellyThingCreator.getThingUID is a valid/supported thing type. ShellyDeviceProfile.isGeneration2 doesn't care if the provided thingType is valid, I should probably have added a test demonstrating that (e.g. "remember_minix?" returning true).

@jlaur jlaur deleted the shelly-mapping-tests branch July 13, 2024 12:25
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Jul 18, 2024
lsiepel pushed a commit that referenced this pull request Jul 25, 2024
@lsiepel lsiepel added the patch A PR that has been cherry-picked to a patch release branch label Jul 25, 2024
@lsiepel
Copy link
Contributor

lsiepel commented Jul 25, 2024

Needed this to cherry pick into 4.2. due to another depending PR that was build on top of this.

pgfeller pushed a commit to pgfeller/openhab-addons that referenced this pull request Sep 29, 2024
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Patrik Gfeller <[email protected]>
joni1993 pushed a commit to joni1993/openhab-addons that referenced this pull request Oct 15, 2024
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Oct 18, 2024
cipianpascu pushed a commit to cipianpascu/openhab-addons that referenced this pull request Jan 2, 2025
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Ciprian Pascu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch A PR that has been cherry-picked to a patch release branch test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants