-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
ansible-test should warn when all collections content is ignored by git #59991
Comments
Files identified in the description: If these files are inaccurate, please update the |
I also hit this pretty hard, I was going to file a new issue but this one covers it, so I'll give my writeup here. Situation: I need to get the sanity tests to run, I have most of what's needed up at ansible/awx#5004. See this target for the overall flow:
(hack comment is in reference to #61884) To explain the need for I really feel needs some solution. Requiring the file structure There are 2 sides the the coin. The testing should require either:
Right now, it requires a form of both, and that creates a very narrow and undocumented envelope where you can get this to work. |
@AlanCoding Source control is not required to use |
Let me number these. Workaround 1: abs path
I think what you're telling me looks like editing the target this way: diff --git a/Makefile b/Makefile
index c0daed9048..42df8e5ccb 100644
--- a/Makefile
+++ b/Makefile
@@ -400,14 +400,13 @@ flake8_collection:
test_collection_all: prepare_collection_venv test_collection flake8_collection test_collection_sanity
test_collection_sanity:
- rm -rf sanity
- mkdir -p sanity
- mkdir -p sanity/ansible_collections
- mkdir -p sanity/ansible_collections/awx
- cp -Ra awx_collection sanity/ansible_collections/awx/awx # symlinks do not work
- cd sanity/ansible_collections/awx/awx && ansible-playbook -i localhost, make_imports_absolute.yml # hack because sanity tests do not fully work
- cd sanity/ansible_collections/awx/awx && git init && git add . # requires both this file structure and a git repo, so there you go
- cd sanity/ansible_collections/awx/awx && ansible-test sanity --test validate-modules
+ rm -rf /tmp/sanity
+ mkdir -p /tmp/sanity
+ mkdir -p /tmp/sanity/ansible_collections
+ mkdir -p /tmp/sanity/ansible_collections/awx
+ cp -Ra awx_collection /tmp/sanity/ansible_collections/awx/awx # symlinks do not work
+ cd /tmp/sanity/ansible_collections/awx/awx && ansible-playbook -i localhost, make_imports_absolute.yml # hack because sanity tests do not fully work
+ cd /tmp/sanity/ansible_collections/awx/awx && ansible-test sanity --test validate-modules
build_collection:
ansible-playbook -i localhost, awx_collection/template_galaxy.yml -e collection_package=$(COLLECTION_PACKAGE) -e namespace_name=$(COLLECTION_NAMESPACE) -e package_version=$(VERSION) I ran and confirmed that works Workaround 2: do not ignoreI confirmed that if I remove my testing folder from diff --git a/.gitignore b/.gitignore
index 60d960b66e..be22f947ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -138,7 +138,6 @@ use_dev_supervisor.txt
awx_collection_test_venv/
awx_collection/*.tar.gz
awx_collection/galaxy.yml
-sanity/
.idea/*
*.unison.tmp
diff --git a/Makefile b/Makefile
index c0daed9048..09f4594dbe 100644
--- a/Makefile
+++ b/Makefile
@@ -406,7 +406,6 @@ test_collection_sanity:
mkdir -p sanity/ansible_collections/awx
cp -Ra awx_collection sanity/ansible_collections/awx/awx # symlinks do not work
cd sanity/ansible_collections/awx/awx && ansible-playbook -i localhost, make_imports_absolute.yml # hack because sanity tests do not fully work
- cd sanity/ansible_collections/awx/awx && git init && git add . # requires both this file structure and a git repo, so there you go
cd sanity/ansible_collections/awx/awx && ansible-test sanity --test validate-modules
build_collection: Workaround 3: git init hackeryThis is what I have in #59991 (comment) Exactly which workaround someone is going to like is a matter of preference, and I personally would rather do the |
In the first example you should be able to simplify the directory creation to just the following since the
|
closing as per above |
SUMMARY
Running ansible-test with collections inside a folder which is ignored by git will result is all targets skipped by ansible-test.
ISSUE TYPE
Feature Idea
COMPONENT NAME
ansible-test
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Run ansible test inside a collection that is in a folder which is ignored by git
EXPECTED RESULTS
Some warning should be displayed
ACTUAL RESULTS
No warning or way to know what is wrong
The text was updated successfully, but these errors were encountered: