mirror of
https://github.com/ansible/awx.git
synced 2026-01-23 15:38:06 -03:30
Merge pull request #13361 from relrod/sanity
[collection] Run sanity tests outside of our container
This commit is contained in:
commit
ac9871b36f
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
@ -28,9 +28,6 @@ jobs:
|
||||
- name: awx-collection
|
||||
command: /start_tests.sh test_collection_all
|
||||
label: Run Collection Tests
|
||||
- name: awx-collection-sanity
|
||||
command: /start_tests.sh test_collection_sanity
|
||||
label: Run Ansible core Collection Sanity tests
|
||||
- name: api-schema
|
||||
label: Check API Schema
|
||||
command: /start_tests.sh detect-schema-change SCHEMA_DIFF_BASE_BRANCH=${{ github.event.pull_request.base.ref }}
|
||||
@ -148,3 +145,22 @@ jobs:
|
||||
env:
|
||||
AWX_TEST_IMAGE: awx
|
||||
AWX_TEST_VERSION: ci
|
||||
|
||||
collection-sanity:
|
||||
name: awx_collection sanity
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# The containers that GitHub Actions use have Ansible installed, so upgrade to make sure we have the latest version.
|
||||
- name: Upgrade ansible-core
|
||||
run: python3 -m pip install --upgrade ansible-core
|
||||
|
||||
- name: Run sanity tests
|
||||
run: make test_collection_sanity
|
||||
env:
|
||||
# needed due to cgroupsv2. This is fixed, but a stable release
|
||||
# with the fix has not been made yet.
|
||||
ANSIBLE_TEST_PREFER_PODMAN: 1
|
||||
|
||||
4
.github/workflows/e2e_test.yml
vendored
4
.github/workflows/e2e_test.yml
vendored
@ -6,7 +6,7 @@ env:
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [labeled]
|
||||
jobs:
|
||||
jobs:
|
||||
e2e-test:
|
||||
if: contains(github.event.pull_request.labels.*.name, 'qe:e2e')
|
||||
runs-on: ubuntu-latest
|
||||
@ -107,5 +107,3 @@ jobs:
|
||||
with:
|
||||
name: AWX-logs-${{ matrix.job }}
|
||||
path: make-docker-compose-output.log
|
||||
|
||||
|
||||
|
||||
20
Makefile
20
Makefile
@ -9,6 +9,17 @@ VERSION := $(shell $(PYTHON) tools/scripts/scm_version.py)
|
||||
|
||||
# ansible-test requires semver compatable version, so we allow overrides to hack it
|
||||
COLLECTION_VERSION ?= $(shell $(PYTHON) tools/scripts/scm_version.py | cut -d . -f 1-3)
|
||||
# args for the ansible-test sanity command
|
||||
COLLECTION_SANITY_ARGS ?= --docker
|
||||
# collection unit testing directories
|
||||
COLLECTION_TEST_DIRS ?= awx_collection/test/awx
|
||||
# collection integration test directories (defaults to all)
|
||||
COLLECTION_TEST_TARGET ?=
|
||||
# args for collection install
|
||||
COLLECTION_PACKAGE ?= awx
|
||||
COLLECTION_NAMESPACE ?= awx
|
||||
COLLECTION_INSTALL = ~/.ansible/collections/ansible_collections/$(COLLECTION_NAMESPACE)/$(COLLECTION_PACKAGE)
|
||||
COLLECTION_TEMPLATE_VERSION ?= false
|
||||
|
||||
# NOTE: This defaults the container image version to the branch that's active
|
||||
COMPOSE_TAG ?= $(GIT_BRANCH)
|
||||
@ -290,13 +301,6 @@ test:
|
||||
cd awxkit && $(VENV_BASE)/awx/bin/tox -re py3
|
||||
awx-manage check_migrations --dry-run --check -n 'missing_migration_file'
|
||||
|
||||
COLLECTION_TEST_DIRS ?= awx_collection/test/awx
|
||||
COLLECTION_TEST_TARGET ?=
|
||||
COLLECTION_PACKAGE ?= awx
|
||||
COLLECTION_NAMESPACE ?= awx
|
||||
COLLECTION_INSTALL = ~/.ansible/collections/ansible_collections/$(COLLECTION_NAMESPACE)/$(COLLECTION_PACKAGE)
|
||||
COLLECTION_TEMPLATE_VERSION ?= false
|
||||
|
||||
test_collection:
|
||||
rm -f $(shell ls -d $(VENV_BASE)/awx/lib/python* | head -n 1)/no-global-site-packages.txt
|
||||
if [ "$(VENV_BASE)" ]; then \
|
||||
@ -339,7 +343,7 @@ test_collection_sanity:
|
||||
if ! [ -x "$(shell command -v ansible-test)" ]; then pip install ansible-core; fi
|
||||
ansible --version
|
||||
COLLECTION_VERSION=1.0.0 make install_collection
|
||||
cd $(COLLECTION_INSTALL) && ansible-test sanity --exclude=plugins/modules/export.py
|
||||
cd $(COLLECTION_INSTALL) && ansible-test sanity $(COLLECTION_SANITY_ARGS)
|
||||
|
||||
test_collection_integration: install_collection
|
||||
cd $(COLLECTION_INSTALL) && ansible-test integration $(COLLECTION_TEST_TARGET)
|
||||
|
||||
3
awx_collection/tests/config.yml
Normal file
3
awx_collection/tests/config.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
modules:
|
||||
python_requires: '>3'
|
||||
@ -1,88 +0,0 @@
|
||||
plugins/module_utils/awxkit.py import-3.9
|
||||
plugins/module_utils/controller_api.py import-3.9
|
||||
plugins/modules/ad_hoc_command.py import-3.9
|
||||
plugins/modules/ad_hoc_command_cancel.py import-3.9
|
||||
plugins/modules/ad_hoc_command_wait.py import-3.9
|
||||
plugins/modules/application.py import-3.9
|
||||
plugins/modules/controller_meta.py import-3.9
|
||||
plugins/modules/credential.py import-3.92
|
||||
plugins/modules/credential_input_source.py import-3.9
|
||||
plugins/modules/credential_type.py import-3.9
|
||||
plugins/modules/execution_environment.py import-3.9
|
||||
plugins/modules/export.py import-3.9
|
||||
plugins/modules/group.py import-3.9
|
||||
plugins/modules/host.py import-3.9
|
||||
plugins/modules/import.py import-3.9
|
||||
plugins/modules/instance.py import-3.9
|
||||
plugins/modules/instance_group.py import-3.9
|
||||
plugins/modules/inventory.py import-3.9
|
||||
plugins/modules/inventory_source.py import-3.9
|
||||
plugins/modules/inventory_source_update.py import-3.9
|
||||
plugins/modules/job_cancel.py import-3.9
|
||||
plugins/modules/job_launch.py import-3.9
|
||||
plugins/modules/job_list.py import-3.9
|
||||
plugins/modules/job_template.py import-3.93
|
||||
plugins/modules/job_wait.py import-3.9
|
||||
plugins/modules/label.py import-3.9
|
||||
plugins/modules/license.py import-3.9
|
||||
plugins/modules/notification_template.py import-3.9
|
||||
plugins/modules/organization.py import-3.9
|
||||
plugins/modules/project.py import-3.92
|
||||
plugins/modules/project_update.py import-3.9
|
||||
plugins/modules/role.py import-3.9
|
||||
plugins/modules/schedule.py import-3.9
|
||||
plugins/modules/settings.py import-3.9
|
||||
plugins/modules/subscriptions.py import-3.9
|
||||
plugins/modules/team.py import-3.9
|
||||
plugins/modules/token.py import-3.9
|
||||
plugins/modules/user.py import-3.9
|
||||
plugins/modules/workflow_approval.py import-3.9
|
||||
plugins/modules/workflow_job_template.py import-3.9
|
||||
plugins/modules/workflow_job_template_node.py import-3.9
|
||||
plugins/modules/workflow_launch.py import-3.9
|
||||
plugins/modules/workflow_node_wait.py import-3.9
|
||||
plugins/inventory/controller.py import-3.10
|
||||
plugins/lookup/controller_api.py import-3.10
|
||||
plugins/module_utils/awxkit.py import-3.10
|
||||
plugins/module_utils/controller_api.py import-3.10
|
||||
plugins/modules/ad_hoc_command.py import-3.10
|
||||
plugins/modules/ad_hoc_command_cancel.py import-3.10
|
||||
plugins/modules/ad_hoc_command_wait.py import-3.10
|
||||
plugins/modules/application.py import-3.10
|
||||
plugins/modules/controller_meta.py import-3.10
|
||||
plugins/modules/credential.py import-3.10
|
||||
plugins/modules/credential_input_source.py import-3.10
|
||||
plugins/modules/credential_type.py import-3.10
|
||||
plugins/modules/execution_environment.py import-3.10
|
||||
plugins/modules/export.py import-3.10
|
||||
plugins/modules/group.py import-3.10
|
||||
plugins/modules/host.py import-3.10
|
||||
plugins/modules/import.py import-3.10
|
||||
plugins/modules/instance.py import-3.10
|
||||
plugins/modules/instance_group.py import-3.10
|
||||
plugins/modules/inventory.py import-3.10
|
||||
plugins/modules/inventory_source.py import-3.10
|
||||
plugins/modules/inventory_source_update.py import-3.10
|
||||
plugins/modules/job_cancel.py import-3.10
|
||||
plugins/modules/job_launch.py import-3.10
|
||||
plugins/modules/job_list.py import-3.10
|
||||
plugins/modules/job_template.py import-3.10
|
||||
plugins/modules/job_wait.py import-3.10
|
||||
plugins/modules/label.py import-3.10
|
||||
plugins/modules/license.py import-3.10
|
||||
plugins/modules/notification_template.py import-3.10
|
||||
plugins/modules/organization.py import-3.10
|
||||
plugins/modules/project.py import-3.10
|
||||
plugins/modules/project_update.py import-3.10
|
||||
plugins/modules/role.py import-3.10
|
||||
plugins/modules/schedule.py import-3.10
|
||||
plugins/modules/settings.py import-3.10
|
||||
plugins/modules/subscriptions.py import-3.10
|
||||
plugins/modules/team.py import-3.10
|
||||
plugins/modules/token.py import-3.10
|
||||
plugins/modules/user.py import-3.10
|
||||
plugins/modules/workflow_approval.py import-3.10
|
||||
plugins/modules/workflow_job_template.py import-3.10
|
||||
plugins/modules/workflow_job_template_node.py import-3.10
|
||||
plugins/modules/workflow_launch.py import-3.10
|
||||
plugins/modules/workflow_node_wait.py import-3.10
|
||||
1
awx_collection/tests/sanity/ignore-2.14.txt
Normal file
1
awx_collection/tests/sanity/ignore-2.14.txt
Normal file
@ -0,0 +1 @@
|
||||
plugins/modules/export.py validate-modules:nonexistent-parameter-documented # needs awxkit to construct argspec
|
||||
1
awx_collection/tests/sanity/ignore-2.15.txt
Normal file
1
awx_collection/tests/sanity/ignore-2.15.txt
Normal file
@ -0,0 +1 @@
|
||||
plugins/modules/export.py validate-modules:nonexistent-parameter-documented # needs awxkit to construct argspec
|
||||
Loading…
x
Reference in New Issue
Block a user