mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 08:47:42 +08:00
Merge pull request #2332 from ipfs/appveyor-fixes
appveyor: sharness improvements
This commit is contained in:
10
appveyor.yml
10
appveyor.yml
@ -12,8 +12,8 @@ clone_folder: c:\go\src\github.com\ipfs\go-ipfs
|
|||||||
|
|
||||||
environment:
|
environment:
|
||||||
GOPATH: c:\gopath
|
GOPATH: c:\gopath
|
||||||
|
TEST_VERBOSE: 1
|
||||||
#TEST_NO_FUSE: 1
|
#TEST_NO_FUSE: 1
|
||||||
#TEST_VERBOSE: 1
|
|
||||||
#TEST_SUITE: test_sharness_expensive
|
#TEST_SUITE: test_sharness_expensive
|
||||||
#GOFLAGS: -tags nofuse
|
#GOFLAGS: -tags nofuse
|
||||||
global:
|
global:
|
||||||
@ -40,10 +40,10 @@ install:
|
|||||||
# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
|
# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
|
||||||
#
|
#
|
||||||
build_script:
|
build_script:
|
||||||
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make nofuse"'
|
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; export PATH=$GOPATH/bin:$PATH; make nofuse"'
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; export GOFLAGS=''-tags nofuse''; export TEST_NO_FUSE=1; export TEST_VERBOSE=1; export TEST_SUITE=test_sharness_expensive; make $TEST_SUITE"'
|
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; export PATH=$GOPATH/bin:$PATH; export GOFLAGS=''-tags nofuse''; export TEST_NO_FUSE=1; export TEST_VERBOSE=1; export TEST_SUITE=test_sharness_expensive; make $TEST_SUITE"'
|
||||||
|
|
||||||
build:
|
#build:
|
||||||
parallel: true
|
# parallel: true
|
||||||
|
@ -23,6 +23,14 @@ test_sort_cmp() {
|
|||||||
test_cmp "$1_sorted" "$2_sorted"
|
test_cmp "$1_sorted" "$2_sorted"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Same as test_cmp above, but we standardize directory
|
||||||
|
# separators before comparing the files.
|
||||||
|
test_path_cmp() {
|
||||||
|
sed -e "s/\\\\/\//g" "$1" >"$1_std" &&
|
||||||
|
sed -e "s/\\\\/\//g" "$2" >"$2_std" &&
|
||||||
|
test_cmp "$1_std" "$2_std"
|
||||||
|
}
|
||||||
|
|
||||||
# Quote arguments for sh eval
|
# Quote arguments for sh eval
|
||||||
shellquote() {
|
shellquote() {
|
||||||
_space=''
|
_space=''
|
||||||
|
@ -44,10 +44,14 @@ test "$TEST_NO_FUSE" != 1 && test_set_prereq FUSE
|
|||||||
test "$TEST_EXPENSIVE" = 1 && test_set_prereq EXPENSIVE
|
test "$TEST_EXPENSIVE" = 1 && test_set_prereq EXPENSIVE
|
||||||
test "$TEST_NO_DOCKER" != 1 && type docker && test_set_prereq DOCKER
|
test "$TEST_NO_DOCKER" != 1 && type docker && test_set_prereq DOCKER
|
||||||
|
|
||||||
|
TEST_OS=$(uname -s | tr [a-z] [A-Z])
|
||||||
|
test expr "$TEST_OS" : "CYGWIN_NT" >/dev/null && test_set_prereq POSIX
|
||||||
|
|
||||||
if test "$TEST_VERBOSE" = 1; then
|
if test "$TEST_VERBOSE" = 1; then
|
||||||
echo '# TEST_VERBOSE='"$TEST_VERBOSE"
|
echo '# TEST_VERBOSE='"$TEST_VERBOSE"
|
||||||
echo '# TEST_NO_FUSE='"$TEST_NO_FUSE"
|
echo '# TEST_NO_FUSE='"$TEST_NO_FUSE"
|
||||||
echo '# TEST_EXPENSIVE='"$TEST_EXPENSIVE"
|
echo '# TEST_EXPENSIVE='"$TEST_EXPENSIVE"
|
||||||
|
echo '# TEST_OS='"$TEST_OS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# source our generic test lib
|
# source our generic test lib
|
||||||
|
@ -19,7 +19,7 @@ test_expect_success "ipfs init fails" '
|
|||||||
test_must_fail ipfs init 2> init_fail_out
|
test_must_fail ipfs init 2> init_fail_out
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success "ipfs init output looks good" '
|
test_expect_success POSIX "ipfs init output looks good" '
|
||||||
echo "Error: failed to take lock at $IPFS_PATH: permission denied" > init_fail_exp &&
|
echo "Error: failed to take lock at $IPFS_PATH: permission denied" > init_fail_exp &&
|
||||||
test_cmp init_fail_exp init_fail_out
|
test_cmp init_fail_exp init_fail_out
|
||||||
'
|
'
|
||||||
@ -39,14 +39,16 @@ test_expect_success "ipfs cat fails" '
|
|||||||
test_expect_success "ipfs cat no repo message looks good" '
|
test_expect_success "ipfs cat no repo message looks good" '
|
||||||
echo "Error: no ipfs repo found in $IPFS_PATH." > cat_fail_exp &&
|
echo "Error: no ipfs repo found in $IPFS_PATH." > cat_fail_exp &&
|
||||||
echo "please run: ipfs init" >> cat_fail_exp &&
|
echo "please run: ipfs init" >> cat_fail_exp &&
|
||||||
test_cmp cat_fail_exp cat_fail_out
|
test_path_cmp cat_fail_exp cat_fail_out
|
||||||
'
|
'
|
||||||
|
|
||||||
# test that init succeeds
|
# test that init succeeds
|
||||||
test_expect_success "ipfs init succeeds" '
|
test_expect_success "ipfs init succeeds" '
|
||||||
export IPFS_PATH="$(pwd)/.ipfs" &&
|
export IPFS_PATH="$(pwd)/.ipfs" &&
|
||||||
|
echo "IPFS_PATH: \"$IPFS_PATH\"" &&
|
||||||
BITS="2048" &&
|
BITS="2048" &&
|
||||||
ipfs init --bits="$BITS" >actual_init
|
ipfs init --bits="$BITS" >actual_init ||
|
||||||
|
test_fsh cat actual_init
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success ".ipfs/ has been created" '
|
test_expect_success ".ipfs/ has been created" '
|
||||||
|
Reference in New Issue
Block a user