-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from mhjacks/update_tests
Update tests
- Loading branch information
Showing
42 changed files
with
409 additions
and
214 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
# Check for updates to GitHub Actions every week | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,8 @@ | ||
[whitelist] | ||
# As of v4, gitleaks only matches against filename, not path in the | ||
# files directive. Leaving content for backwards compatibility. | ||
files = [ | ||
"ansible/plugins/modules/*.py", | ||
"ansible/tests/unit/test_*.py", | ||
"ansible/tests/unit/v1/*.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,6 @@ | ||
{ | ||
"default": true, | ||
"MD003": false, | ||
"MD013": false, | ||
"MD033": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Ansible Lint # feel free to pick your own name | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Important: This sets up your GITHUB_WORKSPACE environment variable | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Lint Ansible Playbook | ||
uses: ansible/ansible-lint-action@v6 | ||
# Let's point it to the path | ||
with: | ||
path: "/" |
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,57 @@ | ||
--- | ||
name: Ansible unit tests | ||
|
||
# | ||
# Documentation: | ||
# https://help.github.com/en/articles/workflow-syntax-for-github-actions | ||
# | ||
|
||
############################# | ||
# Start the job on all push # | ||
############################# | ||
on: [push, pull_request] | ||
|
||
############### | ||
# Set the Job # | ||
############### | ||
jobs: | ||
ansible_unittests: | ||
# Name the Job | ||
name: Ansible unit tests | ||
strategy: | ||
matrix: | ||
python-version: [3.11.3] | ||
# Set the agent to run on | ||
runs-on: ubuntu-latest | ||
|
||
################## | ||
# Load all steps # | ||
################## | ||
steps: | ||
########################## | ||
# Checkout the code base # | ||
########################## | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
# Full git history is needed to get a proper list of changed files within `super-linter` | ||
fetch-depth: 0 | ||
path: ansible_collections/rhvp/cluster_utils | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest ansible | ||
- name: Run make ansible-sanitytest | ||
run: | | ||
make ansible-sanitytest | ||
- name: Run make ansible-unittest | ||
run: | | ||
make ansible-unittest |
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,44 @@ | ||
--- | ||
name: Super linter | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
# Name the Job | ||
name: Super linter | ||
# Set the agent to run on | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
# Full git history is needed to get a proper list of changed files within `super-linter` | ||
fetch-depth: 0 | ||
|
||
################################ | ||
# Run Linter against code base # | ||
################################ | ||
- name: Lint Code Base | ||
uses: super-linter/super-linter/slim@v7 | ||
env: | ||
VALIDATE_ALL_CODEBASE: true | ||
DEFAULT_BRANCH: main | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# These are the validation we disable atm | ||
VALIDATE_ANSIBLE: false | ||
VALIDATE_BASH: false | ||
VALIDATE_CHECKOV: false | ||
VALIDATE_JSCPD: false | ||
VALIDATE_JSON_PRETTIER: false | ||
VALIDATE_MARKDOWN_PRETTIER: false | ||
VALIDATE_KUBERNETES_KUBECONFORM: false | ||
VALIDATE_PYTHON_PYLINT: false | ||
VALIDATE_SHELL_SHFMT: false | ||
VALIDATE_YAML: false | ||
VALIDATE_YAML_PRETTIER: false | ||
# VALIDATE_DOCKERFILE_HADOLINT: false | ||
# VALIDATE_MARKDOWN: false | ||
# VALIDATE_NATURAL_LANGUAGE: false | ||
# VALIDATE_TEKTON: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.PHONY: ansible-lint | ||
ansible-lint: ## run ansible lint on ansible/ folder | ||
podman run -it -v $(PWD):/workspace:rw,z --workdir /workspace \ | ||
--entrypoint "/usr/local/bin/ansible-lint" quay.io/ansible/creator-ee:latest "-vvv" "roles" "plugins" "playbooks" | ||
|
||
.PHONY: ansible-sanitytest | ||
ansible-sanitytest: ## run ansible unit tests | ||
ansible-test sanity --docker default | ||
|
||
.PHONY: ansible-unittest | ||
ansible-unittest: ## run ansible unit tests | ||
rm -rf tests/output | ||
ansible-test units --docker | ||
|
||
.PHONY: test | ||
test: ansible-sanitytest ansible-unittest |
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
Empty file.
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
Empty file.
Oops, something went wrong.