-
Notifications
You must be signed in to change notification settings - Fork 334
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
Need for expanded guide for contributing. #476
Comments
@l3ender |
@paultaiton We are testing, mainly Sanity testing and functional testing, you may refer to the link below, thank you!
|
@paultaiton Usually we need to install some dependency files for the current environment, you can refer to "requirements-azure.txt" and "sanity-requirements-azure.txt". You can refer to the documentation -- |
@Fred-sun I believe the goal of this issue is to add documentation for this repo/collection's standards for linting, as well as how integration tests can be run for this collection. I've looked through the Ansible doc to try and figure out how to run tests in this repo and have not been able to do so until very recently (from much struggle and the advice in #450 (comment)). The best I've come up with so far is to do the following: In this repo's root directory:
It's taken quite a bit of time and effort of working in this repo before I came up with above. I know it doesn't cover running the whole test suite, but I think it would be helpful to add as documentation (along with the aforementioned linting guidelines). I'm happy to do so; can we reopen this issue and I will create a PR? cc @paultaiton |
@l3ender This will provide more guidance for the execution of relevant tests. You are welcome to provide PR and I will push it forward. Thank you very much! |
Hey guys, I apologize for the delay in submitting a PR for this issue. I do still intend on doing so, however my time has been taken up with my job and personal issues. @l3ender
That should let you run the integration tests. for example in my storage account PR I edited "azcollection/tests/integration/targets/azure_rm_storageaccount" until the test cases covered whatever was missed and needed fixing, and ran |
@paultaiton I followed your steps but keep running into the following error. Do you know how to resolve? -> ansible-test integration azure_rm_storageaccount -v
ERROR: Cannot run integration tests without "roles/test/" or "tests/integration/targets/". I'm working a PR that takes all the notes in this issue and will submit it as soon as I get my problems resolved. :) |
When you're executing the tests, is your shell's pwd the collection directory?
|
Yes, I am installing the collection to a staging directory and then # from repo root dir:
ansible-galaxy collection build .
ansible-galaxy collection install azure-azcollection-*.tar.gz -p tests/staging
cd tests/staging/ansible_collections/azure/azcollection/ |
Other than that I don't have any idea. I made a dedicated VM that I only use for azcollection development, and I cloned the repo directly into ~/.ansible/collections/ansible_collections/azure/ . Other than that I'm doing everything with the default configuration, and it just works for me. |
Turns out I was being bit by ansible/ansible#68499. I've resolved my issue and updated the PR appropriately. |
SUMMARY
The current contributing guide is very basic and could use some elaboration to help onboard new contributors and ease the burden. I'm willing to draft the new guide, but I want to solicit some feedback before I put in the effort.
My current rough outline:
Detail the python linting standards that should be used.
Explain how to set up environment to run
ansible-test integration azure_rm_module
to validate locally before submitting PR.Recommendations for new module design, specifically how the individual modules inherit from module_utils/azure_rm_common.py AzureRMModuleBase class, and instantiate shared management clients by 'property' decorated methods.
@haiyuazhang , @Fred-sun ,
The big question I know I need to ask is around python linting. Which lint software are you guys using while reviewing PRs? I have not had any issues since I started using pycodestyle, but if there's a more specific recommendation from you I'll use it. The current adjustments I've been making are to set max-line-length to 160 characters, ignore 'import not at top of file' errors, and warnings about "line break before binary operator". I'd appreciate confirmation on these as well as any other recommendations on linter tunables, as well as any other feedback you have before I start.
ISSUE TYPE
COMPONENT NAME
CONTRIBUTING.md
ANSIBLE VERSION
The text was updated successfully, but these errors were encountered: