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

Tests - ideas for test suite? #2142

Open
1 task done
NodeJSmith opened this issue Nov 3, 2024 · 1 comment
Open
1 task done

Tests - ideas for test suite? #2142

NodeJSmith opened this issue Nov 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@NodeJSmith
Copy link

Is there an existing feature request for this?

  • I have searched the existing issues

Your feature request

I was hoping to find a test suite that I could use to figure out how to add unit tests to my own automations, but it looks like there aren't any tests for this? Please correct me if I'm missing something there.

I would be interested in contributing to tests but I wanted to see if the core developers had any ideas for how they'd want this to be implemented or plans already in place, so I don't waste time going in a direction that wouldn't be accepted in a PR

@NodeJSmith NodeJSmith added the enhancement New feature or request label Nov 3, 2024
@acockburn
Copy link
Member

Hi there -

Yes, this is something I have thought about without coming to any specific conclusions - AD is essentially a one man development effort, with assistance from other fine people, and testing has never bubbled up high enough in the priority stack to put significant time into.

There are 2 areas I am thinking of, the first being a framework for testing apps, the second would be testing of AD itself.

Testing of AD would break down into 3 areas at least:

  1. Unit Testing
  2. Integration Testing
  3. Regression testing

Of these, I tend to care more regression testing the most, however that is the hardest to really make traction with as we would need test harnesses for HASS and MQTT to do this meaningfully. Not impossible but not trivial. Fort what it's worth, we have stubbed out testing in our CI/CD pipeline which would be the place to build this out.

In addition, a long time ago I added time travel in AD which would allow AD to be started at a specific time and run for a specific time, faster than real time which I always planned to use to assist with testing.

For APP testing, again, I am not sure what this might look like. I know that people have previously built harnesses to help with this, but again, to do this meaningfully would probably need harnesses for HASS and MQTT.

I have speculated that you could do this with MQTT discovery creating devices for HASS that you could then control with other apps - this works well for building devices in AD so I am confident this approach would work, but would take some effort.

So, that's where I am at - if you have ideas for how we could approach this and develop a framework, I am very interested in discussing further - it's probably the sort of thing we would want to throw around a little, so I would encourage you to drop into our discord channel (link is in the docs) and maybe we can come up with some ideas, so that if you are interested in putting something together we can fast track it, I'm always a lot happier to merge PRs when I know what they are and have understood them ahead of time.

In any case, thanks for your interest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants