-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add unit tests for init Signed-off-by: NilashishC <[email protected]> * Updates and fixes Signed-off-by: NilashishC <[email protected]> * Add more options for toml-sort Signed-off-by: NilashishC <[email protected]> * Update tests Signed-off-by: NilashishC <[email protected]> * config updates Signed-off-by: NilashishC <[email protected]> * Remove type checking code from tests Signed-off-by: NilashishC <[email protected]> --------- Signed-off-by: NilashishC <[email protected]>
- Loading branch information
1 parent
c8585ea
commit b178ca1
Showing
55 changed files
with
1,225 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ build/ | |
|
||
*.mypy_cache/ | ||
|
||
*.pytest_cache/ | ||
|
||
*.tox/ | ||
|
||
__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,5 @@ repos: | |
- pytest | ||
args: | ||
- src | ||
- tests | ||
- --python-version=3.9 | ||
pass_filenames: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
[pytest] | ||
testpaths = tests | ||
tmp_path_retention_policy=failed | ||
addopts = --ignore=tests/fixtures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ scenario: | |
- converge | ||
destroy_sequence: | ||
- destroy | ||
{% endraw %} | ||
{%- endraw %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
src/ansible_creator/resources/new_collection/extensions/molecule/utils/vars/vars.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
{% raw %} | ||
collection_root: "{{ lookup( 'pipe', 'git rev-parse --show-toplevel') }}" | ||
{% raw %}collection_root: "{{ lookup( 'pipe', 'git rev-parse --show-toplevel') }}" | ||
integration_tests_path: "{{ collection_root }}/tests/integration/targets/" | ||
molecule_scenario_name: "{{ molecule_scenario_directory | basename }}" | ||
{% endraw %} | ||
{%- endraw %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +0,0 @@ | ||
Will be updated by antsibull-changelog. Do not edit this manually! | ||
|
||
See https://github.com/ansible-community/antsibull-changelog/blob/main/docs/changelogs.rst for information | ||
on how to use antsibull-changelog. | ||
|
||
Check out changelogs/config.yaml for its configuration. You need to change at least the title field in there. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""Constants with default values used throughout the tests.""" | ||
|
||
from pathlib import Path | ||
|
||
|
||
FIXTURES_DIR = (Path(__file__).parent / "fixtures").resolve() |
41 changes: 41 additions & 0 deletions
41
tests/fixtures/collection/testorg/testcol/.github/workflows/test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: GHA for testorg.testcol | ||
|
||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
ansible-lint: | ||
uses: ansible-network/github_actions/.github/workflows/ansible-lint.yml@main | ||
changelog: | ||
uses: ansible-network/github_actions/.github/workflows/changelog.yml@main | ||
integration: | ||
uses: ansible-network/github_actions/.github/workflows/integration_simple.yml@main | ||
sanity: | ||
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main | ||
unit-galaxy: | ||
uses: ansible-network/github_actions/.github/workflows/unit_galaxy.yml@main | ||
|
||
all_green: | ||
if: ${{ always() && (github.event_name != 'schedule') }} | ||
needs: | ||
- changelog | ||
- integration | ||
- sanity | ||
- unit-galaxy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: >- | ||
python -c "assert set([ | ||
'${{ needs.changelog.result }}', | ||
'${{ needs.integration.result }}', | ||
'${{ needs.sanity.result }}', | ||
'${{ needs.unit-galaxy.result }}' | ||
]) == {'success'}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[settings] | ||
known_first_party=ansible_collections.testorg.testcol | ||
line_length=100 | ||
lines_after_imports=2 | ||
lines_between_types=1 | ||
profile=black |
45 changes: 45 additions & 0 deletions
45
tests/fixtures/collection/testorg/testcol/.pre-commit-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/ansible-network/collection_prep | ||
rev: 1.1.1 | ||
hooks: | ||
- id: update-docs | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: no-commit-to-branch | ||
args: [--branch, main] | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/asottile/add-trailing-comma | ||
rev: v3.0.0 | ||
hooks: | ||
- id: add-trailing-comma | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: "v3.0.0" | ||
hooks: | ||
- id: prettier | ||
entry: env CI=1 bash -c "prettier --list-different . || ec=$? && prettier --loglevel=error --write . && exit $ec" | ||
pass_filenames: false | ||
args: [] | ||
additional_dependencies: | ||
- prettier | ||
- prettier-plugin-toml | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
name: Sort import statements using isort | ||
args: ["--filter-files"] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.7.0 | ||
hooks: | ||
- id: black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# files we don't want prettier to ever to look into | ||
.*/ | ||
coverage/ | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# A linked collection directory created by pytest-ansible-units | ||
collections/ | ||
|
||
tests/output/ | ||
|
||
README.md |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/collection/testorg/testcol/.vscode/extensions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["redhat.ansible"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
This should be updated by antsibull-changelog. Do not edit this manually! | ||
|
||
See https://github.com/ansible-community/antsibull-changelog/blob/main/docs/changelogs.rst for | ||
information on how to use antsibull-changelog. | ||
|
||
Check out ``changelogs/config.yaml`` for its configuration. You need to change at least the ``title`` field in there. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Community Code of Conduct | ||
|
||
Please see the official [Ansible Community Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Contributing | ||
|
||
Refer to the [Ansible community guide](https://docs.ansible.com/ansible/devel/community/index.html). |
Oops, something went wrong.