-
Notifications
You must be signed in to change notification settings - Fork 455
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
Reusing testing code across repos #1522
Conversation
60eaf55
to
f9e582e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase from master @cniackz, that will fix the failing test.
Please include the method wait_for_resource_field_selector
in the shared-code.sh as well
Lines 206 to 234 in 1f1d9d4
function wait_for_resource_field_selector() { | |
# example 1 job: | |
# namespace="minio-tenant-1" | |
# codition="condition=Complete" | |
# selector="metadata.name=setup-bucket" | |
# wait_for_resource_field_selector $namespace job $condition $selector | |
# | |
# example 2 tenant: | |
# wait_for_resource_field_selector $namespace job $condition $selector | |
# condition=jsonpath='{.status.currentState}'=Initialized | |
# selector="metadata.name=storage-policy-binding" | |
# wait_for_resource_field_selector $namespace tenant $condition $selector 900s | |
namespace=$1 | |
resourcetype=$2 | |
condition=$3 | |
fieldselector=$4 | |
if [ $# -ge 5 ]; then | |
timeout="$5" | |
else | |
timeout="600s" | |
fi | |
echo "Waiting for $resourcetype \"$fieldselector\" for \"$condition\" ($timeout timeout)" | |
kubectl wait -n "$namespace" "$resourcetype" \ | |
--for=$condition \ | |
--field-selector $fieldselector \ | |
--timeout="$timeout" | |
} |
f9e582e
to
4e12431
Compare
@pjuarezd thank you for the code review, I have included the requested function already!. Please review again 👍 |
Objective
To reuse code across repositories.
Plan:
To use git submodules so that code in
shared-functions/shared-code.sh
will be used in other repos.Unrelated:
Tenant Tests On Kind / test-policy-binding
is not related to this changes.Next Steps:
If this gets approved and merged, we can use sub-modules in Enterprise to re-use this function and then we can little by little re-use as much functions and code as possible since testing is being done the same way with Kind