Merge pull request #682 from thockin/v4_e2e_init_test_cleanup

e2e: rename init tests, remove default-val args
This commit is contained in:
Kubernetes Prow Robot 2023-02-17 04:19:56 -08:00 committed by GitHub
commit 1edf40bc2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 42 deletions

View File

@ -255,9 +255,9 @@ function remove_containers() {
# #
############################################## ##############################################
# Test HEAD one-time when root doesn't exist # Test init when root doesn't exist
############################################## ##############################################
function e2e::sync_head_once_root_doesnt_exist() { function e2e::init_root_doesnt_exist() {
echo "$FUNCNAME" > "$REPO"/file echo "$FUNCNAME" > "$REPO"/file
git -C "$REPO" commit -qam "$FUNCNAME" git -C "$REPO" commit -qam "$FUNCNAME"
@ -265,7 +265,6 @@ function e2e::sync_head_once_root_doesnt_exist() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT/subdir" \ --root="$ROOT/subdir" \
--link="link" \ --link="link" \
>> "$1" 2>&1 >> "$1" 2>&1
@ -275,9 +274,9 @@ function e2e::sync_head_once_root_doesnt_exist() {
} }
############################################## ##############################################
# Test HEAD one-time when root exists and is empty # Test init when root exists and is empty
############################################## ##############################################
function e2e::sync_head_once_root_exists_empty() { function e2e::init_root_exists_empty() {
echo "$FUNCNAME" > "$REPO"/file echo "$FUNCNAME" > "$REPO"/file
git -C "$REPO" commit -qam "$FUNCNAME" git -C "$REPO" commit -qam "$FUNCNAME"
@ -285,7 +284,6 @@ function e2e::sync_head_once_root_exists_empty() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 >> "$1" 2>&1
@ -295,9 +293,9 @@ function e2e::sync_head_once_root_exists_empty() {
} }
############################################## ##############################################
# Test HEAD one-time with a weird --root flag # Test init with a weird --root flag
############################################## ##############################################
function e2e::sync_head_once_root_flag_is_weird() { function e2e::init_root_flag_is_weird() {
echo "$FUNCNAME" > "$REPO"/file echo "$FUNCNAME" > "$REPO"/file
git -C "$REPO" commit -qam "$FUNCNAME" git -C "$REPO" commit -qam "$FUNCNAME"
@ -305,7 +303,6 @@ function e2e::sync_head_once_root_flag_is_weird() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="../../../../../$ROOT/../../../../../../$ROOT" \ --root="../../../../../$ROOT/../../../../../../$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 >> "$1" 2>&1
@ -315,9 +312,9 @@ function e2e::sync_head_once_root_flag_is_weird() {
} }
############################################## ##############################################
# Test HEAD one-time with a symlink in --root # Test init with a symlink in --root
############################################## ##############################################
function e2e::sync_head_once_root_flag_has_symlink() { function e2e::init_root_flag_has_symlink() {
echo "$FUNCNAME" > "$REPO"/file echo "$FUNCNAME" > "$REPO"/file
git -C "$REPO" commit -qam "$FUNCNAME" git -C "$REPO" commit -qam "$FUNCNAME"
ln -s "$ROOT" "$ROOT/rootlink" # symlink to test ln -s "$ROOT" "$ROOT/rootlink" # symlink to test
@ -326,7 +323,6 @@ function e2e::sync_head_once_root_flag_has_symlink() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT/rootlink" \ --root="$ROOT/rootlink" \
--link="link" \ --link="link" \
>> "$1" 2>&1 >> "$1" 2>&1
@ -336,9 +332,9 @@ function e2e::sync_head_once_root_flag_has_symlink() {
} }
############################################## ##############################################
# Test HEAD one-time when root is under a git repo # Test init when root is under a git repo
############################################## ##############################################
function e2e::sync_head_once_root_exists_but_is_not_git_root() { function e2e::init_root_is_under_another_repo() {
echo "$FUNCNAME" > "$REPO"/file echo "$FUNCNAME" > "$REPO"/file
git -C "$REPO" commit -qam "$FUNCNAME" git -C "$REPO" commit -qam "$FUNCNAME"
@ -351,7 +347,6 @@ function e2e::sync_head_once_root_exists_but_is_not_git_root() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT/subdir/root" \ --root="$ROOT/subdir/root" \
--link="link" \ --link="link" \
>> "$1" 2>&1 >> "$1" 2>&1
@ -361,9 +356,9 @@ function e2e::sync_head_once_root_exists_but_is_not_git_root() {
} }
############################################## ##############################################
# Test HEAD one-time when root fails sanity # Test init when root fails sanity
############################################## ##############################################
function e2e::sync_head_once_root_exists_but_fails_sanity() { function e2e::init_root_fails_sanity() {
echo "$FUNCNAME" > "$REPO"/file echo "$FUNCNAME" > "$REPO"/file
git -C "$REPO" commit -qam "$FUNCNAME" git -C "$REPO" commit -qam "$FUNCNAME"
SHA=$(git -C "$REPO" rev-parse HEAD) SHA=$(git -C "$REPO" rev-parse HEAD)
@ -376,7 +371,6 @@ function e2e::sync_head_once_root_exists_but_fails_sanity() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev="HEAD" \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 >> "$1" 2>&1
@ -390,7 +384,7 @@ function e2e::sync_head_once_root_exists_but_fails_sanity() {
## FIXME: test when repo is valid git, and is already correct ## FIXME: test when repo is valid git, and is already correct
############################################## ##############################################
# Test HEAD one-time with an absolute-path link # Test init with an absolute-path link
############################################## ##############################################
function e2e::sync_absolute_link() { function e2e::sync_absolute_link() {
echo "$FUNCNAME" > "$REPO"/file echo "$FUNCNAME" > "$REPO"/file
@ -411,7 +405,7 @@ function e2e::sync_absolute_link() {
} }
############################################## ##############################################
# Test HEAD one-time with a subdir-path link # Test init with a subdir-path link
############################################## ##############################################
function e2e::sync_subdir_link() { function e2e::sync_subdir_link() {
echo "$FUNCNAME" > "$REPO"/file echo "$FUNCNAME" > "$REPO"/file
@ -573,7 +567,6 @@ function e2e::worktree_cleanup() {
--period=100ms \ --period=100ms \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 & >> "$1" 2>&1 &
@ -624,7 +617,6 @@ function e2e::readlink() {
--period=100ms \ --period=100ms \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 & >> "$1" 2>&1 &
@ -722,7 +714,6 @@ function e2e::sync_branch_switch() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch=$OTHER_BRANCH \ --branch=$OTHER_BRANCH \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 >> "$1" 2>&1
@ -1127,7 +1118,6 @@ function e2e::sync_on_signal_sighup() {
--sync-on-signal="SIGHUP" \ --sync-on-signal="SIGHUP" \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 & >> "$1" 2>&1 &
@ -1161,7 +1151,6 @@ function e2e::sync_on_signal_hup() {
--sync-on-signal="HUP" \ --sync-on-signal="HUP" \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 & >> "$1" 2>&1 &
@ -1195,7 +1184,6 @@ function e2e::sync_on_signal_1() {
--sync-on-signal=1 \ --sync-on-signal=1 \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 & >> "$1" 2>&1 &
@ -1333,7 +1321,6 @@ function e2e::sync_fetch_skip_depth_1() {
--depth=1 \ --depth=1 \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 & >> "$1" 2>&1 &
@ -1379,7 +1366,6 @@ function e2e::auth_password_wrong_password() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 || true >> "$1" 2>&1 || true
@ -1403,7 +1389,6 @@ function e2e::auth_password_correct_password() {
--period=100ms \ --period=100ms \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 & >> "$1" 2>&1 &
@ -1455,7 +1440,6 @@ function e2e::auth_askpass_url_wrong_password() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 || true >> "$1" 2>&1 || true
@ -1492,7 +1476,6 @@ function e2e::auth_askpass_url_correct_password() {
--period=100ms \ --period=100ms \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 & >> "$1" 2>&1 &
@ -1556,7 +1539,6 @@ function e2e::auth_askpass_url_flaky() {
--period=100ms \ --period=100ms \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 & >> "$1" 2>&1 &
@ -2334,7 +2316,6 @@ function e2e::auth_ssh() {
--period=100ms \ --period=100ms \
--repo="test@$IP:/src" \ --repo="test@$IP:/src" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
--ssh \ --ssh \
@ -2383,7 +2364,6 @@ function e2e::sparse_checkout() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
--sparse-checkout-file="$WORK/sparseconfig" \ --sparse-checkout-file="$WORK/sparseconfig" \
@ -2407,7 +2387,6 @@ function e2e::additional_git_configs() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
--git-config='http.postBuffer:10485760,sect.k1:"a val",sect.k2:another val' \ --git-config='http.postBuffer:10485760,sect.k1:"a val",sect.k2:another val' \
@ -2521,7 +2500,6 @@ function e2e::touch_file() {
--period=100ms \ --period=100ms \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
--touch-file="touch.file" \ --touch-file="touch.file" \
@ -2577,7 +2555,6 @@ function e2e::touch_file_abs_path() {
--period=100ms \ --period=100ms \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
--touch-file="$ROOT/dir/touch.file" \ --touch-file="$ROOT/dir/touch.file" \
@ -2656,7 +2633,6 @@ function e2e::github_https() {
--one-time \ --one-time \
--repo="https://github.com/kubernetes/git-sync" \ --repo="https://github.com/kubernetes/git-sync" \
--branch=master \ --branch=master \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
>> "$1" 2>&1 >> "$1" 2>&1
@ -2674,7 +2650,6 @@ function e2e::gc_auto() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
--git-gc="auto" \ --git-gc="auto" \
@ -2695,7 +2670,6 @@ function e2e::gc_always() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
--git-gc="always" \ --git-gc="always" \
@ -2716,7 +2690,6 @@ function e2e::gc_aggressive() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
--git-gc="aggressive" \ --git-gc="aggressive" \
@ -2737,7 +2710,6 @@ function e2e::gc_off() {
--one-time \ --one-time \
--repo="file://$REPO" \ --repo="file://$REPO" \
--branch="$MAIN_BRANCH" \ --branch="$MAIN_BRANCH" \
--rev=HEAD \
--root="$ROOT" \ --root="$ROOT" \
--link="link" \ --link="link" \
--git-gc="off" \ --git-gc="off" \