Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add better support for testing relation operations #154
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
simonklb commentedOct 24, 2016
Currently, I haven't been able to find an easy way to test adding, removing and readding relations properly using Amulet.
The solution I've come up with so far is using wait_for_message function in conjunction with the relation function in sentry and polling it continuously until it gives the appropriate response (throwing the "Relationship not found" exception in the case of removal).
Until recently this have worked fairly well. But now the tests have started to light up red due to the relation states (i.e. xxxx.available etc) not being active. After debugging it, the problem seem to be removing and then re-adding the relations too quickly which makes the *-joined hooks never fire.
Whether or not this is a Juju issue or an Amulet issue I leave up to you to decide. But as important as this is for the charm to work properly, adding and removing relations should be something that is tested thoroughly.