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

Add github action for sanity and unit tests #1393

Merged
merged 15 commits into from
Apr 20, 2023

Conversation

GomathiselviS
Copy link
Collaborator

SUMMARY

Add github action workflow.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

@GomathiselviS GomathiselviS marked this pull request as draft February 27, 2023 21:15
@softwarefactory-project-zuul
Copy link
Contributor

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/a19a5935e3e845ada11741b3aa22cdc9

✔️ ansible-galaxy-importer SUCCESS in 4m 32s
✔️ build-ansible-collection SUCCESS in 12m 18s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 12m 20s (non-voting)
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 11m 59s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 13m 22s
✔️ ansible-test-sanity-aws-ansible-2.14 SUCCESS in 12m 09s
ansible-test-units-amazon-aws-python36 FAILURE in 7m 12s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 11m 44s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 11m 00s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 12m 47s
✔️ cloud-tox-py3 SUCCESS in 8m 17s

@lmilbaum
Copy link
Contributor

I would suggest using pre-commit github action

@tremble
Copy link
Contributor

tremble commented Feb 28, 2023

I would suggest using pre-commit github action

It's possible to run many of these tests locally (we should probably do a better job of documenting this), however they usually take a couple of minutes to run, so running them as part of the upload process would probably be frustrating.

Additionally, some folks struggle to understand the errors. It's much easier to collaborate with them once it's uploaded and the errors are publically available,

So I'd recommend not blocking commits or the submission of pushes on broken tests

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

In general I like the direction this is taking. Some comments inline.


jobs:
ansible-lint:
uses: ansible-network/github_actions/.github/workflows/ansible-lint.yml@main
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
uses: ansible-network/github_actions/.github/workflows/ansible-lint.yml@main
uses: ansible-network/github_actions/.github/workflows/ansible-lint.yml@main

Can we move these from ansible-network out into ansible-community somewhere please? There's a lot of random stuff living under ansible-network and it's really confusing if you're not familiar with the history.

Having them live in ansible-network gives the impression that either they're specifically intended only for the network modules. Or that the ansible-network group are the sole owners of these actions. IMHO they would be better "owned" by the community, and people outside of the network folks may be more inclined to contribute to them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cc @Qalthos .

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree with what tremble suggested. @jillr @gravesm?

.github/workflows/tests.yml Outdated Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
@tremble
Copy link
Contributor

tremble commented Feb 28, 2023

Looking at actions/runner#2347 I have a concern that we can't do "optional" tests.

There doesn't seem to be a clean way to allow "devel" tests to fail while still blocking merges if the tests fail. GitHub also don't seem interested in offering such a feature :/

Had a quick poke about with "experimental", but I don't see a clean way to do conditional experimental

@lmilbaum
Copy link
Contributor

I would suggest using pre-commit github action

It's possible to run many of these tests locally (we should probably do a better job of documenting this), however they usually take a couple of minutes to run, so running them as part of the upload process would probably be frustrating.

Additionally, some folks struggle to understand the errors. It's much easier to collaborate with them once it's uploaded and the errors are publically available,

So I'd recommend not blocking commits or the submission of pushes on broken tests

 It is not a must to activate it on local repos. Just invoke it during the CI workflow.

@tremble

This comment was marked as resolved.

@tremble

This comment was marked as resolved.

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/b5f26bc09e7e410e99307ba11736a71f

✔️ ansible-galaxy-importer SUCCESS in 4m 52s
✔️ build-ansible-collection SUCCESS in 12m 21s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 11m 37s (non-voting)
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 12m 11s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 12m 10s
✔️ ansible-test-sanity-aws-ansible-2.14 SUCCESS in 11m 41s
ansible-test-units-amazon-aws-python36 FAILURE in 9m 27s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 11m 43s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 11m 53s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 12m 01s
✔️ cloud-tox-py3 SUCCESS in 8m 04s
ansible-test-changelog FAILURE in 4m 11s
✔️ ansible-test-splitter SUCCESS in 4m 38s
integration-amazon.aws-1 FAILURE in 8m 09s
✔️ integration-amazon.aws-2 SUCCESS in 9m 34s
Skipped 42 jobs

softwarefactory-project-zuul bot pushed a commit that referenced this pull request Mar 1, 2023
Cleanup and move tasks (vs playbooks) in inventory tests

SUMMARY
Inventory plugin tests currently mix "tasks" content in with playbooks, this triggers ansible-lint warnings.
ISSUE TYPE

Tests Pull Request

COMPONENT NAME
ec2_vpc_net
plugins/inventory/aws_ec2.py
plugins/inventory/aws_rds.py
ADDITIONAL INFORMATION
Spotted by work on #1393

Reviewed-by: Alina Buzachis
@GomathiselviS GomathiselviS mentioned this pull request Mar 3, 2023
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/b87f8693b2e345df878978f35e1328fa

✔️ ansible-galaxy-importer SUCCESS in 4m 07s
✔️ build-ansible-collection SUCCESS in 12m 21s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 9m 35s (non-voting)
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 8m 49s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 9m 45s
✔️ ansible-test-sanity-aws-ansible-2.14 SUCCESS in 8m 43s
ansible-test-units-amazon-aws-python36 FAILURE in 6m 44s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 8m 15s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 9m 01s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 9m 03s
✔️ cloud-tox-py3 SUCCESS in 8m 27s
ansible-test-changelog FAILURE in 4m 27s
✔️ ansible-test-splitter SUCCESS in 4m 39s
integration-amazon.aws-1 FAILURE in 7m 37s
Skipped 43 jobs

.github/workflows/tests.yml Outdated Show resolved Hide resolved
@GomathiselviS GomathiselviS marked this pull request as ready for review March 3, 2023 19:13
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/b2bf72ca96c045c38401ab438eaa863e

✔️ ansible-galaxy-importer SUCCESS in 4m 36s
✔️ build-ansible-collection SUCCESS in 12m 06s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 13m 13s (non-voting)
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 12m 36s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 12m 44s
✔️ ansible-test-sanity-aws-ansible-2.14 SUCCESS in 12m 22s
ansible-test-units-amazon-aws-python36 FAILURE in 9m 42s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 10m 55s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 10m 21s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 12m 40s
✔️ cloud-tox-py3 SUCCESS in 7m 41s
ansible-test-changelog FAILURE in 4m 12s
✔️ ansible-test-splitter SUCCESS in 4m 45s
integration-amazon.aws-1 RETRY_LIMIT in 1m 28s
Skipped 43 jobs

@GomathiselviS GomathiselviS changed the title WIP: Add github action for sanity and unit tests Add github action for sanity and unit tests Mar 3, 2023
@GomathiselviS GomathiselviS requested review from Qalthos, tremble and gravesm and removed request for Qalthos March 3, 2023 20:45

jobs:
linters:
uses: abikouo/github_actions/.github/workflows/tox-linters.yml@tox_linters
Copy link
Member

Choose a reason for hiding this comment

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

My preference would be to hold off on merging until we get these changes merged into the ansible-network repo, as I'd like to avoid calling out to personal repos. I won't block on this if people feel strongly that this is worth merging now, but ultimately, I want our CI burden to be shared more broadly than it has been in the past. Otherwise, I think everything looks good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jillr suggested that we can go ahead with the merge and not wait until the migration of ansible-network/github_actions repo. PRs on other cloud collections have been merged, which use the workflows from personal repo. @jillr , What do you think about this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry I thought we were talking about merging things into the repo in the ansible-network org, without waiting for that repo to be migrated to the ansible-community org. Is that not the case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are calls to @abikouo's repos which we will update in a separate PR, post the migration of github-actions repo.

@tremble tremble mentioned this pull request Apr 20, 2023
@tremble
Copy link
Contributor

tremble commented Apr 20, 2023

@jillr For what it's worth we're already pulling from @abikouo's fork in "update collection variables":

 15 jobs: 
 16   update-variables:
 17     uses: abikouo/github_actions/.github/workflows/update_aws_variables.yml@automate_aws_user_agent_variable

I think update_aws_variables.yml probably needs to move into this repo.

@abikouo
Copy link
Contributor

abikouo commented Apr 20, 2023

@jillr For what it's worth we're already pulling from @abikouo's fork in "update collection variables":

 15 jobs: 
 16   update-variables:
 17     uses: abikouo/github_actions/.github/workflows/update_aws_variables.yml@automate_aws_user_agent_variable

I think update_aws_variables.yml probably needs to move into this repo.

all these calls to personal repo will be changed once we agree where this should live

softwarefactory-project-zuul bot pushed a commit that referenced this pull request Apr 20, 2023
Minor Sanity test fixes

SUMMARY
Steal sanity fixes from #1393
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/backup_tag_info.py
plugins/modules/backup_vault.py
plugins/modules/route53_info.py
test-requirements.txt
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis
@tremble
Copy link
Contributor

tremble commented Apr 20, 2023

The sanity fixes have been merged as #1462 and I've stripped this back to just the GitHub Action related pieces

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/2ed9c6c87b15414bbe5c5acfca2dea55

✔️ ansible-galaxy-importer SUCCESS in 3m 47s
✔️ build-ansible-collection SUCCESS in 12m 52s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 10m 33s (non-voting)
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 11m 56s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 19m 57s
✔️ ansible-test-sanity-aws-ansible-2.14 SUCCESS in 12m 17s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 8m 44s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 8m 06s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 7m 59s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 11m 59s
✔️ cloud-tox-py3 SUCCESS in 7m 51s

@GomathiselviS
Copy link
Collaborator Author

The sanity fixes have been merged as #1462 and I've stripped this back to just the GitHub Action related pieces

Thank you

@GomathiselviS GomathiselviS added the mergeit Merge the PR (SoftwareFactory) label Apr 20, 2023
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/8e14cefadab542eaa5e35e9cc6107931

✔️ ansible-galaxy-importer SUCCESS in 5m 34s
✔️ build-ansible-collection SUCCESS in 13m 03s

@softwarefactory-project-zuul
Copy link
Contributor

Pull request merge failed: Resource not accessible by integration, You may need to manually rebase your PR and retry.

@tremble tremble merged commit 68a36b2 into ansible-collections:main Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_review feature This issue/PR relates to a feature request integration tests/integration mergeit Merge the PR (SoftwareFactory) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants