Subject: |
RE: Zenpack Development Testing |
Author: |
Morgan Timney |
Posted: |
2019-03-03 11:55 |
Hello Martin,
Have you been following the directions here?
Welcome to the ZenPack SDK! - ZenPack SDK 2.1.1 documentation
Between that and Jane Curry's pdf
ZenPack Developers' Guide, you can get a pretty good workflow that does not involve a full restart with each code change. It all depends on which part of the code you modify, but some code changed don't even require restarts, others just a restart of a few containers.
On the other hand, for some code changes you actually need to uninstall a
zenpack before you even make a code change (like any sort of relationship modification). I found this out the hard way.
Morgan
------------------------------
Morgan Timney
The Southern Company
Birmingham AL
------------------------------
Subject: |
RE: Zenpack Development Testing |
Author: |
Patrick McMahon |
Posted: |
2019-03-06 10:01 |
Martin,
For the ZenPacks I developed in my Professional Services role at Zenoss, I developed a way to do unit testing of ZenPacks without a running Zenoss. It's not a best practice, just a repeatable way to help develop a ZenPack quickly and catch silly errors early. You will still need to do final testing within a running Zenoss but it should cut down on how many times you have to do that. Please find the documentation attached along with a python script that is referenced. You will need to rename build_zenpack.txt to build_zenpack.py. I'm sure there's mistakes so feedback welcome.
Thanks
-Patrick
------------------------------
Patrick McMahon
Sr. Security and Compliance Specialist
Zenoss
------------------------------
Attachments:
build_zenpack.txt
Subject: |
RE: Zenpack Development Testing |
Author: |
Martin |
Posted: |
2019-03-14 12:45 |
Thanks Patrick, I will certainly try this out.
------------------------------
Martin
------------------------------
Subject: |
RE: Zenpack Development Testing |
Author: |
Jane Curry |
Posted: |
2019-03-14 10:38 |
I tend to develop ZenPacks on a Zenoss 4 platform, even if the ultimate target is Zenoss 5/6 - much faster to restart stuff and more chance of just restarting the affected daemons.
Cheers,
Jane
------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------
Subject: |
RE: Zenpack Development Testing |
Author: |
Jay Stanley |
Posted: |
2019-04-03 08:47 |
I develop on Zenoss 4 as well. It has such a smaller footprint and it quicker to restart needed services and set traces.
With that said, I do have a 6 instance I push my ZenPacks to for testing and also when I need to develop strictly against a 6 instance.
@Morgan is correct, some services you do not need to even restart. If you are following the ZPL Dev guide to setup your environment and are using the shared /z directory, then you can just connect to a container and run the daemon for a quick test most of the time.
Also, what restarts are needed is dependent on what you are writing/editing.
Some examples:
YAML files - ZP needs to be installed for changes to take place
Datasource collect method and beyond (onSuccess, onError, etc) - Just the collection damon
Datasource params and config - zenhub restart
Modelers - zenmodeler restart
------------------------------
jstanley
------------------------------