Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
eebc5e0d
Unverified
Commit
eebc5e0d
authored
Jan 03, 2018
by
Edward Thomson
Committed by
GitHub
Jan 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4257 from pks-t/pks/stale-test
Execute stale tests
parents
a223bae5
5874e151
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
43 additions
and
58 deletions
+43
-58
.travis.yml
+1
-1
appveyor.yml
+2
-7
script/cibuild.sh
+7
-21
tests/CMakeLists.txt
+4
-6
tests/checkout/tree.c
+2
-0
tests/iterator/iterator_helpers.c
+1
-2
tests/iterator/workdir.c
+3
-1
tests/online/clone.c
+17
-7
tests/perf/merge.c
+0
-13
tests/repo/open.c
+2
-0
tests/status/worktree.c
+4
-0
No files found.
.travis.yml
View file @
eebc5e0d
...
...
@@ -17,7 +17,7 @@ env:
-
secure
:
"
YnhS+8n6B+uoyaYfaJ3Lei7cSJqHDPiKJCKFIF2c87YDfmCvAJke8QtE7IzjYDs7UFkTCM4ox+ph2bERUrxZbSCyEkHdjIZpKuMJfYWja/jgMqTMxdyOH9y8JLFbZsSXDIXDwqBlC6vVyl1fP90M35wuWcNTs6tctfVWVofEFbs="
-
GITTEST_INVASIVE_FS_SIZE=1
matrix
:
-
OPTIONS="-DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_WERROR=ON"
-
OPTIONS="-DTHREADSAFE=ON -D
ENABLE_TRACE=ON -D
CMAKE_BUILD_TYPE=Release -DENABLE_WERROR=ON"
-
OPTIONS="-DTHREADSAFE=OFF -DBUILD_EXAMPLES=ON -DENABLE_WERROR=ON"
dist
:
trusty
...
...
appveyor.yml
View file @
eebc5e0d
...
...
@@ -48,13 +48,8 @@ test_script:
# Run this early so we know it's ready by the time we need it
$proxyJob = Start-Job { java -jar $Env:APPVEYOR_BUILD_FOLDER\build\poxyproxy.jar -d --port 8080 --credentials foo:bar }
ctest -V -R libgit2_clar
$env:GITTEST_REMOTE_URL="https://github.com/libgit2/non-existent"
$env:GITTEST_REMOTE_USER="libgit2test"
ctest -V -R libgit2_clar-cred_callback
Receive-Job -Job $proxyJob
$env:GITTEST_REMOTE_PROXY_URL = "http://foo:bar@localhost:8080"
ctest -V -R libgit2_clar-proxy_credentials_in_url
$env:GITTEST_REMOTE_PROXY_URL = "http://localhost:8080"
$env:GITTEST_REMOTE_PROXY_URL = "localhost:8080"
$env:GITTEST_REMOTE_PROXY_USER = "foo"
$env:GITTEST_REMOTE_PROXY_PASS = "bar"
ctest -V -R libgit2_clar-proxy_credentials
_request
ctest -V -R libgit2_clar-proxy_credentials
script/cibuild.sh
View file @
eebc5e0d
...
...
@@ -85,32 +85,18 @@ else
export
GITTEST_REMOTE_SSH_FINGERPRINT
=
$(
ssh-keygen
-F
'[localhost]:2222'
-l
| tail
-n
1 | cut
-d
' '
-f
2 | tr
-d
':'
)
fi
# Use the SSH server
export
GITTEST_REMOTE_URL
=
"ssh://localhost:2222/
$HOME
/_temp/test.git"
export
GITTEST_REMOTE_USER
=
$USER
export
GITTEST_REMOTE_SSH_KEY
=
"
$HOME
/.ssh/id_rsa"
export
GITTEST_REMOTE_SSH_PUBKEY
=
"
$HOME
/.ssh/id_rsa.pub"
export
GITTEST_REMOTE_SSH_PASSPHRASE
=
""
ctest
-V
-R
libgit2_clar-ssh
||
exit
$?
if
[
-e
./libgit2_clar
]
;
then
./libgit2_clar
-sonline
::push
-sonline
::clone::ssh_cert
&&
./libgit2_clar
-sonline
::clone::ssh_with_paths
||
exit
$?
if
[
"
$TRAVIS_OS_NAME
"
=
"linux"
]
;
then
./libgit2_clar
-sonline
::clone::cred_callback
||
exit
$?
fi
# Use the proxy we started at the beginning
export
GITTEST_REMOTE_PROXY_URL
=
"http://foo:bar@localhost:8080/"
./libgit2_clar
-sonline
::clone::proxy_credentials_in_url
||
exit
$?
export
GITTEST_REMOTE_PROXY_URL
=
"http://localhost:8080/"
export
GITTEST_REMOTE_PROXY_USER
=
"foo"
export
GITTEST_REMOTE_PROXY_PASS
=
"bar"
./libgit2_clar
-sonline
::clone::proxy_credentials_request
||
exit
$?
fi
# Use the proxy we started at the beginning
export
GITTEST_REMOTE_PROXY_URL
=
"localhost:8080"
export
GITTEST_REMOTE_PROXY_USER
=
"foo"
export
GITTEST_REMOTE_PROXY_PASS
=
"bar"
ctest
-V
-R
libgit2_clar-proxy_credentials
||
exit
$?
kill
$(
cat
"
$HOME
/sshd/pid"
)
export
GITTEST_REMOTE_URL
=
"https://github.com/libgit2/non-existent"
export
GITTEST_REMOTE_USER
=
"libgit2test"
ctest
-V
-R
libgit2_clar-cred_callback
tests/CMakeLists.txt
View file @
eebc5e0d
...
...
@@ -20,7 +20,7 @@ ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/clar.suite
COMMAND
${
PYTHON_EXECUTABLE
}
generate.py -o "
${
CMAKE_CURRENT_BINARY_DIR
}
" -f -xonline -xstress .
COMMAND
${
PYTHON_EXECUTABLE
}
generate.py -o "
${
CMAKE_CURRENT_BINARY_DIR
}
" -f -xonline -xstress
-xperf
.
DEPENDS
${
SRC_TEST
}
WORKING_DIRECTORY
${
CLAR_PATH
}
)
...
...
@@ -58,8 +58,6 @@ ELSE ()
ADD_TEST(libgit2_clar "
${
libgit2_BINARY_DIR
}
/libgit2_clar
" -v -xclone::local::git_style_unc_paths -xclone::local::standard_unc_paths_are_written_git_style)
ENDIF ()
# Add a test target which runs the cred callback tests, to be
# called after setting the url and user
ADD_TEST(libgit2_clar-cred_callback "
${
libgit2_BINARY_DIR
}
/libgit2_clar
" -v -sonline::clone::cred_callback)
ADD_TEST(libgit2_clar-proxy_credentials_in_url "
${
libgit2_BINARY_DIR
}
/libgit2_clar
" -v -sonline::clone::proxy_credentials_in_url)
ADD_TEST(libgit2_clar-proxy_credentials_request "
${
libgit2_BINARY_DIR
}
/libgit2_clar
" -v -sonline::clone::proxy_credentials_request)
# Add additional test targets that require special setup
ADD_TEST(libgit2_clar-proxy_credentials "
${
libgit2_BINARY_DIR
}
/libgit2_clar
" -v -sonline::clone::proxy_credentials_in_url -sonline::clone::proxy_credentials_request)
ADD_TEST(libgit2_clar-ssh "
${
libgit2_BINARY_DIR
}
/libgit2_clar
" -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths)
tests/checkout/tree.c
View file @
eebc5e0d
...
...
@@ -1096,6 +1096,8 @@ void test_checkout_tree__filemode_preserved_in_workdir(void)
cl_assert
(
!
GIT_PERMS_IS_EXEC
(
read_filemode
(
"a/b.txt"
)));
git_commit_free
(
commit
);
#else
cl_skip
();
#endif
}
...
...
tests/iterator/iterator_helpers.c
View file @
eebc5e0d
...
...
@@ -51,8 +51,7 @@ void expect_iterator_items(
cl_assert
(
entry
->
mode
!=
GIT_FILEMODE_TREE
);
}
if
(
++
count
>=
expected_flat
)
break
;
cl_assert
(
++
count
<=
expected_flat
);
}
assert_at_end
(
i
,
v
);
...
...
tests/iterator/workdir.c
View file @
eebc5e0d
...
...
@@ -662,7 +662,7 @@ void test_iterator_workdir__filesystem_gunk(void)
/* should only have 13 items, since we're not asking for trees to be
* returned. the goal of this test is simply to not crash.
*/
expect_iterator_items
(
i
,
1
3
,
NULL
,
13
,
NULL
);
expect_iterator_items
(
i
,
1
5
,
NULL
,
15
,
NULL
);
git_iterator_free
(
i
);
git_buf_free
(
&
parent
);
}
...
...
@@ -741,6 +741,8 @@ void test_iterator_workdir__skips_fifos_and_special_files(void)
cl_assert_equal_i
(
GIT_ITEROVER
,
git_iterator_advance
(
&
e
,
i
));
git_iterator_free
(
i
);
#else
cl_skip
();
#endif
}
...
...
tests/online/clone.c
View file @
eebc5e0d
...
...
@@ -263,8 +263,8 @@ static int cred_failure_cb(
void
test_online_clone__cred_callback_failure_return_code_is_tunnelled
(
void
)
{
if
(
!
_remote_url
||
!
_remote_user
)
clar__skip
(
);
_remote_url
=
git__strdup
(
"https://github.com/libgit2/non-existent"
);
_remote_user
=
git__strdup
(
"libgit2test"
);
g_options
.
fetch_opts
.
callbacks
.
credentials
=
cred_failure_cb
;
...
...
@@ -293,8 +293,8 @@ void test_online_clone__cred_callback_called_again_on_auth_failure(void)
{
size_t
counter
=
0
;
if
(
!
_remote_url
||
!
_remote_user
)
clar__skip
(
);
_remote_url
=
git__strdup
(
"https://github.com/libgit2/non-existent"
);
_remote_user
=
git__strdup
(
"libgit2test"
);
g_options
.
fetch_opts
.
callbacks
.
credentials
=
cred_count_calls_cb
;
g_options
.
fetch_opts
.
callbacks
.
payload
=
&
counter
;
...
...
@@ -677,24 +677,34 @@ static int proxy_creds(git_cred **out, const char *url, const char *username, un
void
test_online_clone__proxy_credentials_request
(
void
)
{
git_buf
url
=
GIT_BUF_INIT
;
if
(
!
_remote_proxy_url
||
!
_remote_proxy_user
||
!
_remote_proxy_pass
)
cl_skip
();
cl_git_pass
(
git_buf_printf
(
&
url
,
"http://%s/"
,
_remote_proxy_url
));
g_options
.
fetch_opts
.
proxy_opts
.
type
=
GIT_PROXY_SPECIFIED
;
g_options
.
fetch_opts
.
proxy_opts
.
url
=
_remote_proxy_url
;
g_options
.
fetch_opts
.
proxy_opts
.
url
=
url
.
ptr
;
g_options
.
fetch_opts
.
proxy_opts
.
credentials
=
proxy_creds
;
called_proxy_creds
=
0
;
cl_git_pass
(
git_clone
(
&
g_repo
,
"http://github.com/libgit2/TestGitRepository"
,
"./foo"
,
&
g_options
));
cl_assert
(
called_proxy_creds
);
git_buf_free
(
&
url
);
}
void
test_online_clone__proxy_credentials_in_url
(
void
)
{
if
(
!
_remote_proxy_url
)
git_buf
url
=
GIT_BUF_INIT
;
if
(
!
_remote_proxy_url
||
!
_remote_proxy_user
||
!
_remote_proxy_pass
)
cl_skip
();
cl_git_pass
(
git_buf_printf
(
&
url
,
"http://%s:%s@%s/"
,
_remote_proxy_user
,
_remote_proxy_pass
,
_remote_proxy_url
));
g_options
.
fetch_opts
.
proxy_opts
.
type
=
GIT_PROXY_SPECIFIED
;
g_options
.
fetch_opts
.
proxy_opts
.
url
=
_remote_proxy_url
;
g_options
.
fetch_opts
.
proxy_opts
.
url
=
url
.
ptr
;
called_proxy_creds
=
0
;
cl_git_pass
(
git_clone
(
&
g_repo
,
"http://github.com/libgit2/TestGitRepository"
,
"./foo"
,
&
g_options
));
cl_assert
(
called_proxy_creds
==
0
);
...
...
tests/perf/merge.c
View file @
eebc5e0d
...
...
@@ -25,20 +25,7 @@
#define ID_BRANCH_A "d853fb9f24e0fe63b3dce9fbc04fd9cfe17a030b"
#define ID_BRANCH_B "1ce9ea3ba9b4fa666602d52a5281d41a482cc58b"
void
test_perf_merge__initialize
(
void
)
{
}
void
test_perf_merge__cleanup
(
void
)
{
}
void
test_perf_merge__m1
(
void
)
{
#if 1
cl_skip
();
#else
perf__do_merge
(
SRC_REPO
,
"m1"
,
ID_BRANCH_A
,
ID_BRANCH_B
);
#endif
}
tests/repo/open.c
View file @
eebc5e0d
...
...
@@ -180,6 +180,8 @@ void test_repo_open__from_git_new_workdir(void)
cl_assert_
(
git__suffixcmp
(
git_repository_workdir
(
repo2
),
"alternate/"
)
==
0
,
git_repository_workdir
(
repo2
));
git_repository_free
(
repo2
);
#else
cl_skip
();
#endif
}
...
...
tests/status/worktree.c
View file @
eebc5e0d
...
...
@@ -1072,6 +1072,8 @@ void test_status_worktree__unreadable(void)
cl_assert_equal_i
(
counts
.
expected_entry_count
,
counts
.
entry_count
);
cl_assert_equal_i
(
0
,
counts
.
wrong_status_flags_count
);
cl_assert_equal_i
(
0
,
counts
.
wrong_sorted_path
);
#else
cl_skip
();
#endif
}
...
...
@@ -1106,6 +1108,8 @@ void test_status_worktree__unreadable_not_included(void)
cl_assert_equal_i
(
counts
.
expected_entry_count
,
counts
.
entry_count
);
cl_assert_equal_i
(
0
,
counts
.
wrong_status_flags_count
);
cl_assert_equal_i
(
0
,
counts
.
wrong_sorted_path
);
#else
cl_skip
();
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment