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

create controller_managed_device_groups #432

Open
wants to merge 38 commits into
base: develop
Choose a base branch
from

Conversation

pugnacity
Copy link
Contributor

@pugnacity pugnacity commented Oct 1, 2024

This should fix #423

@pugnacity pugnacity marked this pull request as ready for review October 2, 2024 10:02
that:
- test_two['changed']
- test_two['controller_managed_device_group']['name'] == "Test Controller Group One"

Copy link
Contributor

Choose a reason for hiding this comment

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

For the integration tests, we try and stick to a pattern like this:

  • Create with minimal required fields
  • Try and create again to verify idempotency
  • Create a second object with all fields
  • Try and create again to verify idempotency
  • Update one of the previous objects
  • Try and update again to verify idempotency
  • Delete one of the previous objects
  • Try and delete again to verify idempotency

Please refactor your tests to follow this pattern.

plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/device.py Show resolved Hide resolved
plugins/modules/device.py Show resolved Hide resolved
tasks.py Outdated Show resolved Hide resolved
pugnacity and others added 8 commits October 2, 2024 19:34
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
url: "{{ nautobot_url }}"
token: "{{ nautobot_token }}"
name: Test Controller Group One
weight: 2000
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please add an assertion to validate that this field did indeed change?

- test_three['changed']
- test_three['controller_managed_device_group']['name'] == "Test Controller Group One"
- test_three['msg'] == "controller_managed_device_group Test Controller Group One updated"

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a duplicate update test to verify idempotency

plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/device.py Outdated Show resolved Hide resolved
@joewesch
Copy link
Contributor

joewesch commented Jan 6, 2025

Hello @pugnacity, just checking in with this PR. Do you require any assistance or have you just not been able to dedicate any time to it lately?

@pugnacity
Copy link
Contributor Author

Hello @joewesch it's a combination of no time and problems to get the tests to work...locally it seems to work. but the pipeline doesn't like it.

tests/integration/targets/latest/tasks/main.yml Outdated Show resolved Hide resolved
- test_six['controller_managed_device_group'] == None
- test_six['msg'] == "controller_managed_device_group Test Controller Group Two already absent"

when:
Copy link
Contributor

Choose a reason for hiding this comment

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

This block and when should no longer be needed as we do it in main.yml now.

pugnacity and others added 5 commits January 9, 2025 19:04
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
…ce_group.yml

Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
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.

New Model: Managed Device Group
2 participants