Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove test references to old CI#5615

Closed
bk2204 wants to merge 2 commits into
git-lfs:mainfrom
bk2204:bye-bye-old-ci
Closed

Remove test references to old CI#5615
bk2204 wants to merge 2 commits into
git-lfs:mainfrom
bk2204:bye-bye-old-ci

Conversation

@bk2204

@bk2204 bk2204 commented Jan 11, 2024

Copy link
Copy Markdown
Member

We no longer use Appveyor or TravisCI, so let's remove references to them in the testsuite.

This test has been broken for a while, but we hadn't noticed because of
an unexpected way of skipping the test for TravisCI, which we no longer
use.

In TravisCI, the `TRAVIS` environment variable is set to 1.  However,
in other environments, it is usually not set.  As a consequence, it
expands to the empty string.

The `if` statement in sh is not the `if` statement in C, and thus it
does not take a boolean value, and "1" would not be a valid value here.
The empty string is a valid value, though, and it is interpreted as a
no-op command, much like `:` or `true`, which are the customary ways to
write this.  Because this command always succeeds, we always skip this
branch, and the body of the test is not executed.

After removing this, our test fails because `assert_clean_status` is not
run in a Git repository.  We clearly wanted to run it in `$newclonedir`,
so let's do that.  In addition, the text "Git LFS:" is no longer
printed, so don't look for it.  With those changes, this test now
passes.
We no longer use Appveyor or TravisCI, so let's remove references to
them in the testsuite.
@chrisd8088

Copy link
Copy Markdown
Member

I think PR #5882 has now addressed the Travis CI portions of this draft PR, and it turns out the AppVeyor bits are actually still important (although we don't use that service anymore), so I'd suggest we might be able to close this PR.


For reference, I've included below the patch I expect to use to deal with the seemingly AppVeyor-related environment variable. I'll put this into a future PR, but the crux of it is that the APPVEYOR_REPO_COMMIT_MESSAGE environment variable is really just an example designed to check that the Environ() function in our lfs package ignores all environment variables that don't start with GIT_, including those which happen to have GIT_ in their values.

This was originally a problem exposed by commit 0951c69 in PR #1825, and then quickly addressed in commit 32244d9 of the same PR, at which time the fake AppVeyor variable added to the test suite's environment to confirm that the problem was fixed.

Specifically, the earlier commit had the string GIT_SSH in its message, and the AppVeyor CI service automatically provided the message from the most recent commit in a Git branch under test in the APPVEYOR_REPO_COMMIT_MESSAGE environment variable. At the time, the Environ() function would populate the map it returns with the names and values of any environment variables whose names or values contained the string GIT_. The result was that the APPVEYOR_REPO_COMMIT_MESSAGE variable was included in the returned environment, which would cause the tests in what is now our t/t-env.sh test script to fail.

Anyway, as I said, I have another round or two of test suite fixups underway, and I'll deal with this environment variable curiosity in those with a change like the one below.

diff --git a/t/t-env.sh b/t/t-env.sh
index 34fe0575..cfdadea9 100755
--- a/t/t-env.sh
+++ b/t/t-env.sh
@@ -10,6 +10,10 @@ if [ "$IS_WINDOWS" -eq 1 ]; then
   export MSYS2_ENV_CONV_EXCL="GIT_LFS_TEST_DIR"
 fi
 
+# The "git lfs env" command should ignore this environment variable
+# despite the "GIT_" strings in its name and value.
+export TEST_GIT_EXAMPLE="GIT_EXAMPLE"
+
 begin_test "env with no remote"
 (
   set -e
diff --git a/t/t-worktree.sh b/t/t-worktree.sh
index ef237238..775067f8 100755
--- a/t/t-worktree.sh
+++ b/t/t-worktree.sh
@@ -11,6 +11,10 @@ if [ "$IS_WINDOWS" -eq 1 ]; then
   export MSYS2_ENV_CONV_EXCL="GIT_LFS_TEST_DIR"
 fi
 
+# The "git lfs env" command should ignore this environment variable
+# despite the "GIT_" strings in its name and value.
+export TEST_GIT_EXAMPLE="GIT_EXAMPLE"
+
 begin_test "git worktree"
 (
     set -e
diff --git a/t/testenv.sh b/t/testenv.sh
index a63122ee..111d2024 100644
--- a/t/testenv.sh
+++ b/t/testenv.sh
@@ -152,7 +152,6 @@ GIT_CONFIG_NOSYSTEM=1
 GIT_TERMINAL_PROMPT=0
 GIT_SSH=lfs-ssh-echo
 GIT_TEMPLATE_DIR="$(native_path "$ROOTDIR/t/fixtures/templates")"
-APPVEYOR_REPO_COMMIT_MESSAGE="test: env test should look for GIT_SSH too"
 LC_ALL=C
 
 export CREDSDIR
@@ -160,7 +159,6 @@ export GIT_LFS_FORCE_PROGRESS
 export GIT_CONFIG_NOSYSTEM
 export GIT_SSH
 export GIT_TEMPLATE_DIR
-export APPVEYOR_REPO_COMMIT_MESSAGE
 export LC_ALL
 
 # Don't fail if run under git rebase -x.

@bk2204

bk2204 commented Oct 30, 2024

Copy link
Copy Markdown
Member Author

Great, I'll close this, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants